| 1 | <?php |
||
| 5 | class Response |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * HTTP Status code |
||
| 9 | * |
||
| 10 | * @int |
||
| 11 | */ |
||
| 12 | protected $status; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Headers. |
||
| 16 | * |
||
| 17 | * @var array |
||
| 18 | */ |
||
| 19 | protected $headers; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Contents. |
||
| 23 | * |
||
| 24 | * @var string |
||
| 25 | */ |
||
| 26 | protected $body; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Assign dependencies. |
||
| 30 | * |
||
| 31 | * @param int $status |
||
| 32 | * @param array $headers |
||
| 33 | * @param string $body |
||
| 34 | */ |
||
| 35 | 22 | public function __construct($status = 200, array $headers = [], $body = null) |
|
| 41 | |||
| 42 | /** |
||
| 43 | * Extracts the relevant content from the response. |
||
| 44 | * |
||
| 45 | * @param Response $response |
||
|
|
|||
| 46 | * |
||
| 47 | * @return array|mixed |
||
| 48 | */ |
||
| 49 | 2 | public function result() |
|
| 63 | |||
| 64 | /** |
||
| 65 | * Get query limit headers. |
||
| 66 | * |
||
| 67 | * @param array $limits |
||
| 68 | * |
||
| 69 | * @return array |
||
| 70 | */ |
||
| 71 | protected function getQueryLimitHeaders(array $limits = []) |
||
| 85 | |||
| 86 | /** |
||
| 87 | * Get body. |
||
| 88 | * |
||
| 89 | * @return string |
||
| 90 | */ |
||
| 91 | 4 | public function getBody() |
|
| 95 | |||
| 96 | /** |
||
| 97 | * Get HTTP status code. |
||
| 98 | * |
||
| 99 | * @return string |
||
| 100 | */ |
||
| 101 | 4 | public function getStatus() |
|
| 105 | |||
| 106 | /** |
||
| 107 | * Get response headers. |
||
| 108 | * |
||
| 109 | * @return array |
||
| 110 | */ |
||
| 111 | 2 | public function getHeaders() |
|
| 115 | |||
| 116 | /** |
||
| 117 | * Get a response header by key. |
||
| 118 | * |
||
| 119 | * @param string $key |
||
| 120 | * |
||
| 121 | * @return string |
||
| 122 | */ |
||
| 123 | 4 | public function getHeader($key) |
|
| 129 | } |
||
| 130 |
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
$italyis not defined by the methodfinale(...).The most likely cause is that the parameter was removed, but the annotation was not.