src/Util/ErrorToExceptionConverter.php
public function convertErrorsToExceptions($level = null, $exceptionClass = null)
    {
        $this->isHandledLocal = true;
        if (is_null($level)) {
            $level = E_ALL;
        }
        if (is_null($exceptionClass)) {
            $exceptionClass = static::EXCEPTION_THROW_CLASS;
        }
        set_error_handler(function ($errorNumber, $errorMessage, $errorFile, $errorLine) use ($exceptionClass) {
            throw new $exceptionClass(
                sprintf("%s in %s on line %s!", $errorMessage, $errorFile, $errorLine),
                $errorNumber
            );
        }, $level);
    }
public function convertErrorsToExceptions($level = null, $exceptionClass = null)
    {
        $this->isHandledLocal = true;
        if (is_null($level)) {
            $level = E_ALL;
        }
        if (is_null($exceptionClass)) {
            $exceptionClass = static::EXCEPTION_THROW_CLASS;
        }
        set_error_handler(function ($errorNumber, $errorMessage, $errorFile, $errorLine) use ($exceptionClass) {
            throw new $exceptionClass(
                sprintf("%s in %s on line %s!", $errorMessage, $errorFile, $errorLine),
                $errorNumber
            );
        }, $level);
    }
public function convertErrorsToExceptions ( $ level = null , $ exceptionClass = null ) { $ this -> isHandledLocal = true ; if ( is_null ( $ level ) ) { $ level = E_ALL ; } if ( is_null ( $ exceptionClass ) ) { $ exceptionClass = static :: EXCEPTION_THROW_CLASS ; } set_error_handler ( function ( $ errorNumber , $ errorMessage , $ errorFile , $ errorLine ) use ( $ exceptionClass ) { throw new $ exceptionClass ( sprintf ( "%s in %s on line %s!" , $ errorMessage , $ errorFile , $ errorLine ) , $ errorNumber ) ; } , $ level ) ; }
Converts errors to exceptions

@param int|null $level The error level to be handled.
See http://php.net/manual/en/errorfunc.constants.php
@param string|null $exceptionClass
Converts errors to exceptions