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   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 55.56%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 28
ccs 5
cts 9
cp 0.5556
rs 10
wmc 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 2
A getError() 0 3 1
A getResponse() 0 3 1
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