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 $wrapper = ''; |
||
28 | |||
29 | /** |
||
30 | * Create a copy of the payload with the status. |
||
31 | * |
||
32 | * @param string $status |
||
33 | * |
||
34 | * @return \BrightComponents\Common\Payloads\Contracts\PayloadContract |
||
35 | */ |
||
36 | public function withStatus($status) |
||
43 | |||
44 | /** |
||
45 | * Get the status of the payload. |
||
46 | * |
||
47 | * @return string |
||
48 | */ |
||
49 | public function getStatus() |
||
53 | |||
54 | /** |
||
55 | * Create a copy of the payload with input array. |
||
56 | * |
||
57 | * @param array $input |
||
58 | * |
||
59 | * @return \BrightComponents\Common\Payloads\Contracts\PayloadContract |
||
60 | */ |
||
61 | public function withInput(array $input) |
||
68 | |||
69 | /** |
||
70 | * Get input array from the payload. |
||
71 | * |
||
72 | * @return array |
||
73 | */ |
||
74 | public function getInput() |
||
78 | |||
79 | /** |
||
80 | * Create a copy of the payload with output array. |
||
81 | * |
||
82 | * @param mixed $output |
||
83 | * |
||
84 | * @return \BrightComponents\Common\Payloads\Contracts\PayloadContract |
||
85 | */ |
||
86 | public function withOutput($output) |
||
93 | |||
94 | /** |
||
95 | * Get output array from the payload. |
||
96 | * |
||
97 | * @return array |
||
98 | */ |
||
99 | public function getOutput() |
||
103 | |||
104 | /** |
||
105 | * Create a copy of the payload with messages array. |
||
106 | * |
||
107 | * @param array $output |
||
|
|||
108 | * |
||
109 | * @return \BrightComponents\Common\Payloads\Contracts\PayloadContract |
||
110 | */ |
||
111 | public function withMessages(array $messages) |
||
118 | |||
119 | /** |
||
120 | * Get messages array from the payload. |
||
121 | * |
||
122 | * @return array |
||
123 | */ |
||
124 | public function getMessages() |
||
128 | |||
129 | /** |
||
130 | * Set a wrapper for payload output. |
||
131 | * |
||
132 | * @param string $wrapper |
||
133 | * |
||
134 | * @return $this |
||
135 | */ |
||
136 | public function setWrapper(string $wrapper) |
||
142 | |||
143 | /** |
||
144 | * Set a wrapper for payload output. Alias for setWrapper. |
||
145 | * |
||
146 | * @param string $wrapper |
||
147 | * |
||
148 | * @return $this |
||
149 | */ |
||
150 | public function wrap(string $wrapper) |
||
154 | |||
155 | /** |
||
156 | * Get the arrayable items. |
||
157 | * |
||
158 | * @param mixed $input |
||
159 | * |
||
160 | * @return array |
||
161 | */ |
||
162 | public function getArrayableItems($input) |
||
180 | } |
||
181 |
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.