1 | <?php |
||
12 | class Response |
||
13 | { |
||
14 | /** |
||
15 | * Returns a response with a particular view loaded. |
||
16 | * |
||
17 | * @param string $view name of the view to load |
||
18 | * @param array $data data to expose to the view |
||
19 | * @param Engine $engine alternative rendering engine |
||
20 | * @return Psr\Http\Message\ResponseInterface |
||
21 | */ |
||
22 | 1 | public static function view(string $view, array $data, Engine $engine = null): ResponseInterface |
|
26 | |||
27 | /** |
||
28 | * Returns a response with a particular view loaded. |
||
29 | * |
||
30 | * @param mixed $json JSON serializable data |
||
|
|||
31 | * @param int $flags JSON flags |
||
32 | * @return Psr\Http\Message\ResponseInterface |
||
33 | */ |
||
34 | 3 | public static function json($data, int $flags = 79): ResponseInterface |
|
38 | |||
39 | /** |
||
40 | * Create a new basic string response. |
||
41 | * |
||
42 | * @param string $string string to respond |
||
43 | * @return Psr\Http\Message\ResponseInterface |
||
44 | */ |
||
45 | 4 | public static function string(string $string): ResponseInterface |
|
49 | |||
50 | /** |
||
51 | * Respond with a 400 bad request error json message. |
||
52 | * |
||
53 | * @return Psr\Http\Message\ResponseInterface |
||
54 | */ |
||
55 | 1 | public static function error400(ServerRequestInterface $request): ResponseInterface |
|
59 | |||
60 | /** |
||
61 | * Respond with a 403 error message. |
||
62 | * |
||
63 | * @return Psr\Http\Message\ResponseInterface |
||
64 | */ |
||
65 | 1 | public static function error403(ServerRequestInterface $request): ResponseInterface |
|
69 | |||
70 | /** |
||
71 | * Respond with a 404 error message. |
||
72 | * |
||
73 | * @return Psr\Http\Message\ResponseInterface |
||
74 | */ |
||
75 | 1 | public static function error404(ServerRequestInterface $request): ResponseInterface |
|
79 | |||
80 | /** |
||
81 | * Respond with a 405 error message. |
||
82 | * |
||
83 | * @return Psr\Http\Message\ResponseInterface |
||
84 | */ |
||
85 | 1 | public static function error405(ServerRequestInterface $request): ResponseInterface |
|
89 | |||
90 | /** |
||
91 | * Respond with a 429 error message. |
||
92 | * |
||
93 | * @return Psr\Http\Message\ResponseInterface |
||
94 | */ |
||
95 | 1 | public static function error429(ServerRequestInterface $request): ResponseInterface |
|
99 | } |
||
100 |
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.