HttpException::getErrors()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Ipag\Sdk\Exception;
4
5
use Ipag\Sdk\Http\Response;
6
use Throwable;
7
8
abstract class HttpException extends BaseException
9
{
10
    protected ?Response $response;
11
    protected ?int $statusCode;
12
    protected ?string $statusMessage;
13
    protected ?array $errors;
14
15
    public function __construct(
16
        string $message = '',
17
        int $code = 0,
18
        ?Throwable $previous = null,
19
        ?Response $response = null,
20
        ?int $statusCode = null,
21
        ?string $statusMessage = null,
22
        ?array $errors = []
23
    ) {
24
        parent::__construct($message, $code, $previous);
25
26
        $this->response = $response;
27
        $this->statusCode = $statusCode;
28
        $this->statusMessage = $statusMessage;
29
        $this->errors = $errors;
30
    }
31
32
    public function getResponse(): ?Response
33
    {
34
        return $this->response;
35
    }
36
37
    public function getStatusCode(): ?int
38
    {
39
        return $this->statusCode;
40
    }
41
42
    public function getStatusMessage(): ?string
43
    {
44
        return $this->statusMessage;
45
    }
46
47
    public function getErrors(): ?array
48
    {
49
        return $this->errors;
50
    }
51
}