RemoteException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 21
ccs 8
cts 8
cp 1
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A getResponse() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Facile\OpenIDClient\Exception;
6
7
use Psr\Http\Message\ResponseInterface;
8
use Throwable;
9
10
class RemoteException extends RuntimeException
11
{
12
    /** @var ResponseInterface */
13
    private $response;
14
15 7
    public function __construct(ResponseInterface $response, ?string $message = null, Throwable $previous = null)
16
    {
17 7
        parent::__construct(
18 7
            $message ?? $response->getReasonPhrase(),
19 7
            $response->getStatusCode(),
20
            $previous
21
        );
22 7
        $this->response = $response;
23 7
    }
24
25
    /**
26
     * @return ResponseInterface
27
     */
28 2
    public function getResponse(): ResponseInterface
29
    {
30 2
        return $this->response;
31
    }
32
}
33