ResponseException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getResponse() 0 4 1
1
<?php declare(strict_types=1);
2
3
namespace Personnage\Tinkoff\SDK\Exception;
4
5
use Personnage\Tinkoff\SDK\Response\Response;
6
7
class ResponseException extends \RuntimeException implements TinkoffSDKException
8
{
9
    /**
10
     * @var Response
11
     */
12
    private $response;
13
14
    public function __construct(Response $response)
15
    {
16
        parent::__construct($response->getErrorMessage(), $response->getErrorCode());
17
18
        $this->response = $response;
19
    }
20
21
    /**
22
     * Get a response instance.
23
     *
24
     * @return Response
25
     */
26
    public function getResponse(): Response
27
    {
28
        return $this->response;
29
    }
30
}
31