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) |
||
30 | |||
31 | /** |
||
32 | * Register the PHP error handler. |
||
33 | * |
||
34 | * @return void |
||
35 | */ |
||
36 | protected function registerErrorHandler() |
||
40 | |||
41 | /** |
||
42 | * Register the PHP exception handler. |
||
43 | * |
||
44 | * @return void |
||
45 | */ |
||
46 | protected function registerExceptionHandler() |
||
50 | |||
51 | /** |
||
52 | * Register a function for execution on shutdown |
||
53 | * |
||
54 | * @return void |
||
55 | */ |
||
56 | protected function registerShutdownHandler() |
||
60 | |||
61 | /** |
||
62 | * @param int $level |
||
63 | * @param string $message |
||
64 | * @param string $file |
||
65 | * @param int $line |
||
66 | * @param array $context |
||
67 | * |
||
68 | * @throws ErrorException |
||
69 | */ |
||
70 | public function handleError(int $level, string $message, string $file = '', int $line = 0, array $context = []) |
||
74 | |||
75 | /** |
||
76 | * @param \Throwable $e |
||
77 | */ |
||
78 | public function handleException(\Throwable $e) |
||
87 | |||
88 | /** |
||
89 | * |
||
90 | */ |
||
91 | public function handleShutdown() |
||
99 | } |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.