src/Suite.php
protected function _errorHandler($enable, $options = [])
    {
        $defaults = ['handler' => null];
        $options += $defaults;
        if (!$enable) {
            return restore_error_handler();
        }
        $handler = function ($code, $message, $file, $line = 0, $args = []) {
            if (error_reporting() === 0) {
                return;
            }
            $trace = debug_backtrace();
            $trace = array_slice($trace, 1, count($trace));
            $message = "`" . Debugger::errorType($code) . "` {$message}";
            $code = 0;
            $exception = compact('code', 'message', 'file', 'line', 'trace');
            throw new PhpErrorException($exception);
        };
        $options['handler'] = $options['handler'] ?: $handler;
        set_error_handler($options['handler'], error_reporting());
    }
protected function _errorHandler($enable, $options = [])
    {
        $defaults = ['handler' => null];
        $options += $defaults;
        if (!$enable) {
            return restore_error_handler();
        }
        $handler = function ($code, $message, $file, $line = 0, $args = []) {
            if (error_reporting() === 0) {
                return;
            }
            $trace = debug_backtrace();
            $trace = array_slice($trace, 1, count($trace));
            $message = "`" . Debugger::errorType($code) . "` {$message}";
            $code = 0;
            $exception = compact('code', 'message', 'file', 'line', 'trace');
            throw new PhpErrorException($exception);
        };
        $options['handler'] = $options['handler'] ?: $handler;
        set_error_handler($options['handler'], error_reporting());
    }
protected function _errorHandler ( $ enable , $ options = [ ] ) { $ defaults = [ 'handler' => null ] ; $ options += $ defaults ; if ( ! $ enable ) { return restore_error_handler ( ) ; } $ handler = function ( $ code , $ message , $ file , $ line = 0 , $ args = [ ] ) { if ( error_reporting ( ) === 0 ) { return ; } $ trace = debug_backtrace ( ) ; $ trace = array_slice ( $ trace , 1 , count ( $ trace ) ) ; $ message = "`" . Debugger :: errorType ( $ code ) . "` {$message}" ; $ code = 0 ; $ exception = compact ( 'code' , 'message' , 'file' , 'line' , 'trace' ) ; throw new PhpErrorException ( $ exception ) ; } ; $ options [ 'handler' ] = $ options [ 'handler' ] ? : $ handler ; set_error_handler ( $ options [ 'handler' ] , error_reporting ( ) ) ; }
Overrides the default error handler

@param boolean $enable  If `true` override the default error handler,
if `false` restore the default handler.
@param array   $options An options array. Available options are:
- 'handler': An error handler closure.
Overrides the default error handler