These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace Tgallice\Wit\Exception; |
||
4 | |||
5 | use Psr\Http\Message\ResponseInterface; |
||
6 | |||
7 | class BadResponseException extends \RuntimeException |
||
8 | { |
||
9 | /** |
||
10 | * @var ResponseInterface |
||
11 | */ |
||
12 | private $response; |
||
13 | |||
14 | /** |
||
15 | * @param string $message |
||
16 | * @param int $statusCode |
||
0 ignored issues
–
show
|
|||
17 | * @param ResponseInterface|null $response |
||
18 | */ |
||
19 | public function __construct($message, ResponseInterface $response = null) |
||
20 | { |
||
21 | $code = $response ? $response->getStatusCode() : 0; |
||
22 | |||
23 | parent::__construct($message, $code); |
||
24 | $this->response = $response; |
||
25 | } |
||
26 | |||
27 | /** |
||
28 | * @return null|ResponseInterface |
||
29 | */ |
||
30 | public function getResponse() |
||
31 | { |
||
32 | return $this->response; |
||
33 | } |
||
34 | } |
||
35 |
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.