1 | <?php |
||
17 | class ServerRequest extends Request implements ServerRequestInterface |
||
18 | { |
||
19 | /** |
||
20 | * @var array |
||
21 | */ |
||
22 | private $attributes; |
||
23 | |||
24 | /** |
||
25 | * @var array |
||
26 | */ |
||
27 | private $cookieParams; |
||
28 | |||
29 | /** |
||
30 | * @var array|object |
||
31 | */ |
||
32 | private $parsedBody; |
||
33 | |||
34 | /** |
||
35 | * @var array |
||
36 | */ |
||
37 | private $queryParams; |
||
38 | |||
39 | /** |
||
40 | * @var array |
||
41 | */ |
||
42 | private $serverParams; |
||
43 | |||
44 | /** |
||
45 | * @var array |
||
46 | */ |
||
47 | private $uploadedFiles; |
||
48 | |||
49 | /** |
||
50 | * @param array $serverParams the value of $_SERVER superglobal. |
||
51 | * @param array $uploadedFiles the value of $_FILES superglobal. |
||
|
|||
52 | * @param string $method HTTP method for the request. |
||
53 | * @param string|UriInterface $uri URI for the request. |
||
54 | * @param array $headers Headers for the message. |
||
55 | * @param string|resource|StreamInterface $body Message body. |
||
56 | * @param string $protocolVersion HTTP protocol version. |
||
57 | * |
||
58 | * @throws InvalidArgumentException for an invalid URI |
||
59 | */ |
||
60 | 7 | public function __construct( |
|
77 | |||
78 | /** |
||
79 | * Return an UploadedFile instance array. |
||
80 | * |
||
81 | * @param array $files A array which respect $_FILES structure. |
||
82 | * |
||
83 | * @throws InvalidArgumentException for unrecognized values |
||
84 | * @return array |
||
85 | */ |
||
86 | 8 | public static function normalizeFiles(array $files) |
|
105 | |||
106 | /** |
||
107 | * Create and return an UploadedFile instance from a $_FILES specification. |
||
108 | * |
||
109 | * If the specification represents an array of values, this method will |
||
110 | * delegate to normalizeNestedFileSpec() and return that return value. |
||
111 | * |
||
112 | * @param array $value $_FILES struct |
||
113 | * |
||
114 | * @return array|UploadedFileInterface |
||
115 | */ |
||
116 | 5 | private static function createUploadedFileFromSpec(array $value) |
|
130 | |||
131 | /** |
||
132 | * Normalize an array of file specifications. |
||
133 | * |
||
134 | * Loops through all nested files and returns a normalized array of |
||
135 | * UploadedFileInterface instances. |
||
136 | * |
||
137 | * @param array $files |
||
138 | * |
||
139 | * @return UploadedFileInterface[] |
||
140 | */ |
||
141 | 1 | private static function normalizeNestedFileSpec(array $files = []) |
|
158 | |||
159 | /** |
||
160 | * Return a ServerRequest populated with superglobals: |
||
161 | * $_GET |
||
162 | * $_POST |
||
163 | * $_COOKIE |
||
164 | * $_FILES |
||
165 | * $_SERVER |
||
166 | * |
||
167 | * @return ServerRequestInterface |
||
168 | */ |
||
169 | 1 | public static function fromGlobals() |
|
185 | |||
186 | /** |
||
187 | * Get a Uri populated with values from $_SERVER. |
||
188 | * |
||
189 | * @return UriInterface |
||
190 | */ |
||
191 | 7 | public static function getUriFromGlobals() |
|
219 | |||
220 | |||
221 | /** |
||
222 | * {@inheritdoc} |
||
223 | */ |
||
224 | 1 | public function getServerParams() |
|
228 | |||
229 | /** |
||
230 | * {@inheritdoc} |
||
231 | */ |
||
232 | 2 | public function getUploadedFiles() |
|
236 | |||
237 | /** |
||
238 | * {@inheritdoc} |
||
239 | */ |
||
240 | 2 | public function withUploadedFiles(array $uploadedFiles) |
|
247 | |||
248 | /** |
||
249 | * {@inheritdoc} |
||
250 | */ |
||
251 | 2 | public function getCookieParams() |
|
255 | |||
256 | /** |
||
257 | * {@inheritdoc} |
||
258 | */ |
||
259 | 2 | public function withCookieParams(array $cookies) |
|
266 | |||
267 | /** |
||
268 | * {@inheritdoc} |
||
269 | */ |
||
270 | 2 | public function getQueryParams() |
|
274 | |||
275 | /** |
||
276 | * {@inheritdoc} |
||
277 | */ |
||
278 | 2 | public function withQueryParams(array $query) |
|
285 | |||
286 | /** |
||
287 | * {@inheritdoc} |
||
288 | */ |
||
289 | 2 | public function getParsedBody() |
|
293 | |||
294 | /** |
||
295 | * {@inheritdoc} |
||
296 | */ |
||
297 | 2 | public function withParsedBody($data) |
|
304 | |||
305 | /** |
||
306 | * {@inheritdoc} |
||
307 | */ |
||
308 | 1 | public function getAttributes() |
|
312 | |||
313 | /** |
||
314 | * {@inheritdoc} |
||
315 | */ |
||
316 | 1 | public function getAttribute($attribute, $default = null) |
|
324 | |||
325 | /** |
||
326 | * {@inheritdoc} |
||
327 | */ |
||
328 | 1 | public function withAttribute($attribute, $value) |
|
335 | |||
336 | /** |
||
337 | * {@inheritdoc} |
||
338 | */ |
||
339 | 1 | public function withoutAttribute($attribute) |
|
350 | } |
||
351 |
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.