| 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 | 24 | 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() |
|
| 60 | |||
| 61 | /** |
||
| 62 | * Get query limit headers. |
||
| 63 | * |
||
| 64 | * @param array $limits |
||
| 65 | * |
||
| 66 | * @return array |
||
| 67 | */ |
||
| 68 | 2 | public function limits(array $limits = []) |
|
| 82 | |||
| 83 | /** |
||
| 84 | * Get body. |
||
| 85 | * |
||
| 86 | * @return string |
||
| 87 | */ |
||
| 88 | 4 | public function getBody() |
|
| 92 | |||
| 93 | /** |
||
| 94 | * Get HTTP status code. |
||
| 95 | * |
||
| 96 | * @return string |
||
| 97 | */ |
||
| 98 | 4 | public function getStatus() |
|
| 102 | |||
| 103 | /** |
||
| 104 | * Get response headers. |
||
| 105 | * |
||
| 106 | * @return array |
||
| 107 | */ |
||
| 108 | 2 | public function getHeaders() |
|
| 112 | |||
| 113 | /** |
||
| 114 | * Get a response header by key. |
||
| 115 | * |
||
| 116 | * @param string $key |
||
| 117 | * |
||
| 118 | * @return string |
||
| 119 | */ |
||
| 120 | 6 | public function getHeader($key) |
|
| 126 | } |
||
| 127 |
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.