Total Complexity | 3 |
Total Lines | 53 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | abstract class FaultManagerException extends \Hoa\Exception\Exception implements IFaultManagerException |
||
21 | { |
||
22 | use TFaultMutator; |
||
23 | |||
24 | /** @var int */ |
||
25 | protected $code = 66000; |
||
26 | |||
27 | /** @var string */ |
||
28 | protected $message = ''; |
||
29 | |||
30 | /** @var array */ |
||
31 | protected $arguments = []; |
||
32 | |||
33 | /** |
||
34 | * FaultManagerException constructor. |
||
35 | * @param null|string $message |
||
36 | * @param int|null $code |
||
37 | * @param null|\Throwable $previous |
||
38 | * @param array|null $arguments |
||
39 | */ |
||
40 | public function __construct( |
||
41 | ?string $message = null, |
||
42 | ?int $code = null, |
||
43 | ?\Throwable $previous = null, |
||
44 | ?array $arguments = null |
||
45 | ) { |
||
46 | // In case an empty message is passed, then use the one from $this->message |
||
47 | if (empty($message)) { |
||
48 | $message = null; // @codeCoverageIgnore |
||
49 | } |
||
50 | |||
51 | parent::__construct( |
||
52 | $message ?? $this->message, |
||
53 | $code ?? $this->code, |
||
54 | $arguments ?? $this->arguments, |
||
55 | $previous |
||
56 | ); |
||
57 | } |
||
58 | |||
59 | /** |
||
60 | * Override parent::send() |
||
61 | * |
||
62 | * Sends the exception on `hoa://Event/Exception`. |
||
63 | * @codeCoverageIgnore |
||
64 | */ |
||
65 | public function send(): void |
||
73 | ); |
||
74 | } |
||
76 |