Zend\Stratigility\Middleware\ErrorHandler::createErrorHandler PHP Method

createErrorHandler() private method

Only raises exceptions for errors that are within the error_reporting mask.
private createErrorHandler ( ) : callable
return callable
    private function createErrorHandler()
    {
        /**
         * @param int $errno
         * @param string $errstr
         * @param string $errfile
         * @param int $errline
         * @return void
         * @throws ErrorException if error is not within the error_reporting mask.
         */
        return function ($errno, $errstr, $errfile, $errline) {
            if (!(error_reporting() & $errno)) {
                // error_reporting does not include this error
                return;
            }
            throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
        };
    }