| 1 | <?php |
||
| 8 | class Handler |
||
| 9 | { |
||
| 10 | const ERROR_HANDLER = 'handleError'; |
||
| 11 | const EXCEPTION_HANDLER = 'handleException'; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * @var FormatterInterface |
||
| 15 | */ |
||
| 16 | private $formatter; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Handler constructor. |
||
| 20 | * |
||
| 21 | * @param FormatterInterface $formatter |
||
| 22 | */ |
||
| 23 | public function __construct(FormatterInterface $formatter) |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Register the PHP error handler. |
||
| 30 | * |
||
| 31 | * @return void |
||
| 32 | */ |
||
| 33 | protected function registerErrorHandler() |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Register the PHP exception handler. |
||
| 40 | * |
||
| 41 | * @return void |
||
| 42 | */ |
||
| 43 | protected function registerExceptionHandler() |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @param int $level |
||
| 50 | * @param string $message |
||
| 51 | * @param string $file |
||
| 52 | * @param int $line |
||
| 53 | * @param array $context |
||
| 54 | * |
||
| 55 | * @throws ErrorException |
||
| 56 | */ |
||
| 57 | public function handleError(int $level, string $message, string $file = '', int $line = 0, array $context = []) |
||
| 61 | |||
| 62 | public function handleException(\Throwable $e) |
||
| 71 | } |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.