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

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 77.78%

Importance

Changes 0
Metric Value
dl 0
loc 24
ccs 7
cts 9
cp 0.7778
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A createFromResponse() 0 9 1
A getResponse() 0 4 1
A setResponse() 0 4 1
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