Total Complexity | 5 |
Total Lines | 42 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
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 |
||
50 | } |
||
51 | } |