1 | <?php |
||
15 | abstract class Handler implements HandlerInterface |
||
16 | { |
||
17 | /* |
||
18 | Return constants that can be returned from Handler::handle |
||
19 | to message the handler walker. |
||
20 | */ |
||
21 | const DONE = 0x10; // returning this is optional, only exists for |
||
22 | // semantic purposes |
||
23 | /** |
||
24 | * The Handler has handled the Throwable in some way, and wishes to skip any other Handler. |
||
25 | * Execution will continue. |
||
26 | */ |
||
27 | const LAST_HANDLER = 0x20; |
||
28 | /** |
||
29 | * The Handler has handled the Throwable in some way, and wishes to quit/stop execution |
||
30 | */ |
||
31 | const QUIT = 0x30; |
||
32 | |||
33 | /** |
||
34 | * @var RunInterface |
||
35 | */ |
||
36 | private $run; |
||
37 | |||
38 | /** |
||
39 | * @var Inspector $inspector |
||
40 | */ |
||
41 | private $inspector; |
||
42 | |||
43 | /** |
||
44 | * @var \Throwable $exception |
||
45 | */ |
||
46 | private $exception; |
||
47 | |||
48 | /** |
||
49 | * @param RunInterface $run |
||
50 | */ |
||
51 | 3 | public function setRun(RunInterface $run) |
|
55 | |||
56 | /** |
||
57 | * @return RunInterface |
||
58 | */ |
||
59 | 1 | protected function getRun() |
|
63 | |||
64 | /** |
||
65 | * @param Inspector $inspector |
||
66 | */ |
||
67 | 3 | public function setInspector(Inspector $inspector) |
|
71 | |||
72 | /** |
||
73 | * @return Inspector |
||
74 | */ |
||
75 | 2 | protected function getInspector() |
|
79 | |||
80 | /** |
||
81 | * @param \Throwable $exception |
||
82 | */ |
||
83 | 3 | public function setException($exception) |
|
87 | |||
88 | /** |
||
89 | * @return \Throwable |
||
90 | */ |
||
91 | 3 | protected function getException() |
|
95 | } |
||
96 |