1 | <?php |
||
12 | class Payload implements PayloadContract |
||
13 | { |
||
14 | /** @var string */ |
||
15 | private $status; |
||
16 | |||
17 | /** @var array */ |
||
18 | private $input = []; |
||
19 | |||
20 | /** @var array */ |
||
21 | private $output = []; |
||
22 | |||
23 | /** @var array */ |
||
24 | private $messages = []; |
||
25 | |||
26 | /** @var string */ |
||
27 | private $outputWrapper = 'data'; |
||
28 | |||
29 | /** @var string */ |
||
30 | private $inputWrapper = 'input'; |
||
31 | |||
32 | /** @var string */ |
||
33 | private $messagesWrapper = 'messages'; |
||
34 | |||
35 | /** |
||
36 | * Create a copy of the payload with the status. |
||
37 | * |
||
38 | * @param string $status |
||
39 | * |
||
40 | * @return \BrightComponents\Common\Payloads\Contracts\PayloadContract |
||
41 | */ |
||
42 | public function withStatus($status) |
||
49 | |||
50 | /** |
||
51 | * Get the status of the payload. |
||
52 | * |
||
53 | * @return string |
||
54 | */ |
||
55 | public function getStatus() |
||
59 | |||
60 | /** |
||
61 | * Create a copy of the payload with input array. |
||
62 | * |
||
63 | * @param array $input |
||
64 | * @param bool $wrap |
||
65 | * |
||
66 | * @return \BrightComponents\Common\Payloads\Contracts\PayloadContract |
||
67 | */ |
||
68 | public function withInput(array $input, bool $wrap = true) |
||
75 | |||
76 | /** |
||
77 | * Get input array from the payload. |
||
78 | * |
||
79 | * @return array |
||
80 | */ |
||
81 | public function getInput() |
||
85 | |||
86 | /** |
||
87 | * Create a copy of the payload with output. |
||
88 | * |
||
89 | * @param mixed $output |
||
90 | * @param bool $wrap |
||
91 | * |
||
92 | * @return \BrightComponents\Common\Payloads\Contracts\PayloadContract |
||
93 | */ |
||
94 | public function withOutput($output, bool $wrap = true) |
||
101 | |||
102 | /** |
||
103 | * Get output array from the payload. |
||
104 | * |
||
105 | * @return array |
||
106 | */ |
||
107 | public function getOutput() |
||
111 | |||
112 | /** |
||
113 | * Create a copy of the payload with messages array. |
||
114 | * |
||
115 | * @param array $output |
||
|
|||
116 | * @param bool $wrap |
||
117 | * |
||
118 | * @return \BrightComponents\Common\Payloads\Contracts\PayloadContract |
||
119 | */ |
||
120 | public function withMessages(array $messages, bool $wrap = true) |
||
127 | |||
128 | /** |
||
129 | * Get messages array from the payload. |
||
130 | * |
||
131 | * @return array |
||
132 | */ |
||
133 | public function getMessages() |
||
137 | |||
138 | /** |
||
139 | * Set a wrapper for payload output. |
||
140 | * |
||
141 | * @param string $wrapper |
||
142 | * |
||
143 | * @return $this |
||
144 | */ |
||
145 | public function setOutputWrapper(string $wrapper) |
||
151 | |||
152 | /** |
||
153 | * Set a wrapper for payload output. Alias for setWrapper. |
||
154 | * |
||
155 | * @param string $wrapper |
||
156 | * |
||
157 | * @return $this |
||
158 | */ |
||
159 | public function wrapOutput(string $wrapper) |
||
163 | |||
164 | /** |
||
165 | * Set a wrapper for payload output. |
||
166 | * |
||
167 | * @param string $wrapper |
||
168 | * |
||
169 | * @return $this |
||
170 | */ |
||
171 | public function setInputWrapper(string $wrapper) |
||
177 | |||
178 | /** |
||
179 | * Set a wrapper for payload output. Alias for setWrapper. |
||
180 | * |
||
181 | * @param string $wrapper |
||
182 | * |
||
183 | * @return $this |
||
184 | */ |
||
185 | public function wrapInput(string $wrapper) |
||
189 | |||
190 | /** |
||
191 | * Set a wrapper for payload output. |
||
192 | * |
||
193 | * @param string $wrapper |
||
194 | * |
||
195 | * @return $this |
||
196 | */ |
||
197 | public function setMessagesWrapper(string $wrapper) |
||
203 | |||
204 | /** |
||
205 | * Set a wrapper for payload output. Alias for setWrapper. |
||
206 | * |
||
207 | * @param string $wrapper |
||
208 | * |
||
209 | * @return $this |
||
210 | */ |
||
211 | public function wrapMessages(string $wrapper) |
||
215 | |||
216 | /** |
||
217 | * Get the arrayable items. |
||
218 | * |
||
219 | * @param mixed $input |
||
220 | * |
||
221 | * @return array |
||
222 | */ |
||
223 | public function getArrayableItems($input) |
||
241 | |||
242 | /** |
||
243 | * Handle dynamic property getters for a payload. |
||
244 | * |
||
245 | * @param mixed $property |
||
246 | * |
||
247 | * @return mixed |
||
248 | */ |
||
249 | public function __get($property) |
||
257 | } |
||
258 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.