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.

ApiException::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 6
ccs 4
cts 4
cp 1
crap 2
rs 10
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|null
14
     */
15
    protected $error;
16
17
    /**
18
     * @var ResponseInterface
19
     */
20
    protected $response;
21
22 378
    public function __construct(ResponseInterface $response, Error $error = null)
23
    {
24 378
        $this->error = $error;
25 378
        $this->response = $response;
26
27 378
        parent::__construct($error ? $error->getMessage() : '', $response->getStatusCode());
28 378
    }
29
30
    public function getError(): ?Error
31
    {
32
        return $this->error;
33
    }
34
35
    public function getResponse(): ResponseInterface
36
    {
37
        return $this->response;
38
    }
39
}
40