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   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 55.56%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 2
dl 0
loc 36
ccs 5
cts 9
cp 0.5556
rs 10
c 0
b 0
f 0

3 Methods

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