1 | <?php |
||
10 | class BodyParser implements ResolverInterface |
||
11 | { |
||
12 | /** |
||
13 | * @var bool Whether convert the object into associative arrays |
||
14 | */ |
||
15 | private $associative = true; |
||
16 | |||
17 | /** |
||
18 | * @var array List of all parseable content types |
||
19 | */ |
||
20 | protected $contentTypes = [ |
||
21 | 'json' => 'application/json', |
||
22 | 'urlencode' => 'application/x-www-form-urlencoded', |
||
23 | 'csv' => 'text/csv', |
||
24 | ]; |
||
25 | |||
26 | /** |
||
27 | * @param string $id |
||
28 | * |
||
29 | * @return callable|null |
||
30 | */ |
||
31 | public function resolve($id) |
||
39 | |||
40 | /** |
||
41 | * JSON parser. |
||
42 | * |
||
43 | * @param ServerRequestInterface $response |
||
|
|||
44 | * |
||
45 | * @return ServerRequestInterface |
||
46 | */ |
||
47 | public function json(ServerRequestInterface $request) |
||
53 | |||
54 | /** |
||
55 | * Parses url-encoded strings. |
||
56 | * |
||
57 | * @param ServerRequestInterface $response |
||
58 | * |
||
59 | * @return ServerRequestInterface |
||
60 | */ |
||
61 | public function urlencode(ServerRequestInterface $request) |
||
67 | |||
68 | /** |
||
69 | * Parses csv strings. |
||
70 | * |
||
71 | * @param ServerRequestInterface $response |
||
72 | * |
||
73 | * @return ServerRequestInterface |
||
74 | */ |
||
75 | public function csv(ServerRequestInterface $request) |
||
94 | } |
||
95 |
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.