1 | <?php |
||
18 | class ErrorToExceptionConverter |
||
19 | { |
||
20 | /** |
||
21 | * @const string Exception class name to be thrown |
||
22 | */ |
||
23 | const EXCEPTION_THROW_CLASS = \Exception::class; |
||
24 | |||
25 | /** |
||
26 | * States that the current object is the current error handler |
||
27 | * @var bool |
||
28 | */ |
||
29 | protected $isHandledLocal = false; |
||
30 | |||
31 | /** |
||
32 | * Converts errors to exceptions |
||
33 | * |
||
34 | * @param int|null $level The error level to be handled. |
||
35 | * See http://php.net/manual/en/errorfunc.constants.php |
||
36 | * @param string|null $exceptionClass |
||
37 | */ |
||
38 | 3 | public function convertErrorsToExceptions($level = null, $exceptionClass = null) |
|
54 | |||
55 | /** |
||
56 | * Restore previous defined error handlers |
||
57 | */ |
||
58 | 1 | public function restoreErrorHandler() |
|
65 | } |
||
66 |