Completed
Push — master ( dee98e...c79f7e )
by Gallice
02:31
created

src/Exception/BadResponseException.php (1 issue)

Labels
Severity

Upgrade to new PHP Analysis Engine

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
There is no parameter named $statusCode. Was it maybe removed?

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 method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
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