| Conditions | 4 |
| Paths | 4 |
| Total Lines | 23 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 22 | public function __construct($wrapperKey, $errorMessage, $responseCode = 200) |
||
| 23 | { |
||
| 24 | if (!is_string($wrapperKey)) { |
||
| 25 | throw new InvalidArgumentException('parameter must be string'); |
||
| 26 | } |
||
| 27 | if (!is_string($errorMessage)) { |
||
| 28 | throw new InvalidArgumentException('parameter must be string'); |
||
| 29 | } |
||
| 30 | if (!is_int($responseCode)) { |
||
| 31 | throw new InvalidArgumentException('parameter must be integer'); |
||
| 32 | } |
||
| 33 | |||
| 34 | parent::__construct($responseCode, 'application/json'); |
||
| 35 | |||
| 36 | $responseBody = [ |
||
| 37 | $wrapperKey => [ |
||
| 38 | 'ok' => false, |
||
| 39 | 'error' => $errorMessage, |
||
| 40 | ], |
||
| 41 | ]; |
||
| 42 | |||
| 43 | $this->setBody(json_encode($responseBody)); |
||
| 44 | } |
||
| 45 | } |
||
| 46 |
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.