Passed
Push — master ( 08894b...cd03f9 )
by Joachim
06:58
created

ApiException::getErrorCode()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Setono\DAO\Exception;
6
7
use Psr\Http\Message\RequestInterface;
8
use Psr\Http\Message\ResponseInterface;
9
10
final class ApiException extends RequestException
11
{
12
    /**
13
     * @var int|null
14
     */
15
    private $errorCode;
16
17
    /**
18
     * @var string|null
19
     */
20
    private $errorMessage;
21
22
    public function __construct(RequestInterface $request, ResponseInterface $response, int $statusCode, int $errorCode, string $errorMessage)
23
    {
24
        $this->errorCode = $errorCode;
25
        $this->errorMessage = $errorMessage;
26
27
        parent::__construct($request, $response, $statusCode);
28
    }
29
30
    public function getErrorCode(): ?int
31
    {
32
        return $this->errorCode;
33
    }
34
35
    public function getErrorMessage(): ?string
36
    {
37
        return $this->errorMessage;
38
    }
39
}
40