| Total Complexity | 2 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class ErrorHandler extends Handler implements HandlerContract |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var callable |
||
| 12 | */ |
||
| 13 | protected $previousHandler; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @return void |
||
| 17 | */ |
||
| 18 | public function register() : void |
||
| 19 | { |
||
| 20 | $this->previousHandler = set_error_handler([$this, 'handle']); |
||
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @param int $code |
||
| 25 | * @param string $error |
||
| 26 | * @param string $file |
||
| 27 | * @param int $line |
||
| 28 | * @return void |
||
| 29 | * |
||
| 30 | * @throws \Honeyhadger\Exceptions\ServiceException |
||
| 31 | */ |
||
| 32 | public function handle($code, $error, $file = null, $line = null) : void |
||
| 39 | } |
||
| 40 | } |
||
| 41 |