src/Base/ErrorHandler.php
public function handleError($code, $message, $file, $line)
    {
        if (error_reporting() & $code) {
            static::loadErrorExceptionClass();
            $exception = new ErrorException($message, $code, $code, $file, $line);

            // in case error appeared in __toString method we can't throw any exception
            $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
            array_shift($trace);
            foreach ($trace as $frame) {
                if ($frame['function'] === '__toString') {
                    $this->handleException($exception);
                }
            }

            throw $exception;
        }

        return false;
    }
public function handleError($code, $message, $file, $line)
    {
        if (error_reporting() & $code) {
            static::loadErrorExceptionClass();
            $exception = new ErrorException($message, $code, $code, $file, $line);

            // in case error appeared in __toString method we can't throw any exception
            $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
            array_shift($trace);
            foreach ($trace as $frame) {
                if ($frame['function'] === '__toString') {
                    $this->handleException($exception);
                }
            }

            throw $exception;
        }

        return false;
    }
Handles PHP execution errors such as warnings and notices.

This method is used as a PHP error handler. It will simply raise an [[ErrorException]].

@param int $code the level of the error raised.
@param string $message the error message.
@param string $file the filename that the error was raised in.
@param int $line the line number the error was raised at.
@return bool whether the normal error handler continues.

@throws ErrorException