1 | <?php |
||
8 | class Handler |
||
9 | { |
||
10 | const ERROR_HANDLER = 'handleError'; |
||
11 | const EXCEPTION_HANDLER = 'handleException'; |
||
12 | const SHUTDOWN_HANDLER = 'handleShutdown'; |
||
13 | |||
14 | /** |
||
15 | * @var FormatterInterface |
||
16 | */ |
||
17 | private $formatter; |
||
18 | |||
19 | /** |
||
20 | * Handler constructor. |
||
21 | * |
||
22 | * @param FormatterInterface $formatter |
||
23 | */ |
||
24 | public function __construct(FormatterInterface $formatter) |
||
34 | |||
35 | protected function disablePHPDisplayErrors() |
||
39 | |||
40 | /** |
||
41 | * Register the PHP error handler. |
||
42 | * |
||
43 | * @return void |
||
44 | */ |
||
45 | protected function registerErrorHandler() |
||
49 | |||
50 | /** |
||
51 | * Register the PHP exception handler. |
||
52 | * |
||
53 | * @return void |
||
54 | */ |
||
55 | protected function registerExceptionHandler() |
||
59 | |||
60 | /** |
||
61 | * Register a function for execution on shutdown |
||
62 | * |
||
63 | * @return void |
||
64 | */ |
||
65 | protected function registerShutdownHandler() |
||
69 | |||
70 | /** |
||
71 | * @param int $level |
||
72 | * @param string $message |
||
73 | * @param string $file |
||
74 | * @param int $line |
||
75 | * @param array $context |
||
76 | * |
||
77 | * @throws ErrorException |
||
78 | */ |
||
79 | public function handleError(int $level, string $message, string $file = '', int $line = 0, array $context = []) |
||
83 | |||
84 | /** |
||
85 | * @param \Throwable $e |
||
86 | */ |
||
87 | public function handleException(\Throwable $e) |
||
96 | |||
97 | /** |
||
98 | * |
||
99 | */ |
||
100 | public function handleShutdown() |
||
108 | } |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.