GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( ae2101...c16a9a )
by Ema
01:41
created

ApiException::__construct()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 5
cts 5
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 1
nop 2
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Pnz\MattermostClient\Exception;
6
7
use Pnz\MattermostClient\Model\Error;
8
use Psr\Http\Message\ResponseInterface;
9
10
class ApiException extends \Exception implements DomainException
11
{
12
    /**
13
     * @var Error
14
     */
15
    protected $error;
16
17
    /**
18
     * @var ResponseInterface
19
     */
20
    protected $response;
21
22 357
    public function __construct(ResponseInterface $response, Error $error = null)
23
    {
24 357
        $this->error = $error;
25 357
        $this->response = $response;
26
27 357
        parent::__construct($error ? $error->getMessage() : '', $response->getStatusCode());
28 357
    }
29
30
    /**
31
     * @return Error|null
32
     */
33
    public function getError()
34
    {
35
        return $this->error;
36
    }
37
38
    /**
39
     * @return ResponseInterface
40
     */
41
    public function getResponse()
42
    {
43
        return $this->response;
44
    }
45
}
46