Total Complexity | 5 |
Total Lines | 33 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | abstract class HttpError extends Exception implements ChuckException |
||
16 | { |
||
17 | protected mixed $payload = null; |
||
18 | |||
19 | 14 | public function __construct( |
|
20 | string $message = '', |
||
21 | int $code = 0, |
||
22 | ?Throwable $previous = null |
||
23 | ) { |
||
24 | 14 | parent::__construct($message, $code, $previous); |
|
25 | } |
||
26 | |||
27 | 1 | public static function withPayload(mixed $payload): static |
|
33 | } |
||
34 | |||
35 | 4 | public function getTitle(): string |
|
36 | { |
||
37 | 4 | return (string)$this->getCode() . ' ' . $this->getMessage(); |
|
38 | } |
||
39 | |||
40 | 1 | public function setPayload(mixed $payload): void |
|
43 | } |
||
44 | |||
45 | 4 | public function getPayload(): mixed |
|
50 |