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.

HTTPResponseException::createFromResponse()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 9
ccs 4
cts 4
cp 1
crap 1
rs 9.9666
c 0
b 0
f 0
1
<?php
2
3
namespace Gbowo\Exception;
4
5
use Exception;
6
use Psr\Http\Message\ResponseInterface;
7
use Gbowo\Contract\Exception\ResponseExceptionInterface;
8
9
abstract class HTTPResponseException extends Exception implements ResponseExceptionInterface
10
{
11
    protected $response;
12
13 18
    public static function createFromResponse(
14
        ResponseInterface $response
15
    ) : Exception {
16 18
        $ret = new static();
17
18 18
        $ret->setResponse($response);
19
20 18
        return $ret;
21
    }
22
23
    public function getResponse(): ResponseInterface
24
    {
25
        return $this->response;
26
    }
27
28 18
    public function setResponse(ResponseInterface $response)
29
    {
30 18
        $this->response = $response;
31 18
    }
32
}
33