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