1 | <?php |
||
12 | final class ErrorHandler implements \Nofw\Error\ErrorHandler |
||
13 | { |
||
14 | private $context = []; |
||
15 | private $processors = []; |
||
16 | |||
17 | public function __construct(array $context = []) |
||
21 | |||
22 | /** |
||
23 | * {@inheritdoc} |
||
24 | */ |
||
25 | public function handle(\Throwable $t, array $context = []): void |
||
34 | |||
35 | /** |
||
36 | * Pushes a processor on to the stack. |
||
37 | * |
||
38 | * @param Processor $processor |
||
39 | * |
||
40 | * @return ErrorHandler |
||
41 | */ |
||
42 | public function pushProcessor(Processor $processor): self |
||
48 | |||
49 | /** |
||
50 | * Pops a processor from the stack. |
||
51 | * |
||
52 | * @return Processor |
||
53 | * |
||
54 | * @throws \LogicException If the processor stack is empty |
||
55 | */ |
||
56 | public function popProcessor(): Processor |
||
64 | |||
65 | /** |
||
66 | * @return array |
||
67 | */ |
||
68 | public function getProcessors(): array |
||
72 | |||
73 | /** |
||
74 | * @param array $processors |
||
75 | * |
||
76 | * @return ErrorHandler |
||
77 | */ |
||
78 | public function setProcessors(array $processors): self |
||
88 | } |
||
89 |