src/exceptions/Handler.php
public static function error( $severity, $message, $file, $line ) {

		// Latest Twig raises a warning when accessing missing cached views - we can ignore it
		if( preg_match('/filemtime/', $message) )
			return;

		// if the error was a type hint failure then throw an InvalidArgumentException instead
		elseif( preg_match('/^Argument (\d+) passed to ([\w\\\\]+)::(\w+)\(\) must be an instance of ([\w\\\\]+), ([\w\\\\]+) given, called in ([\w\s\.\/_-]+) on line (\d+)/', $message, $m) )
			throw new \InvalidArgumentException("Argument {$m[1]} to {$m[2]}::{$m[3]}() should be an instance of {$m[4]}, {$m[5]} given", $severity, new \ErrorException($message, 0, $severity, $m[6], $m[7]));

		// convert the error to an exception
		throw new \ErrorException($message, 0, $severity, $file, $line);

	}
public static function error( $severity, $message, $file, $line ) {

		// Latest Twig raises a warning when accessing missing cached views - we can ignore it
		if( preg_match('/filemtime/', $message) )
			return;

		// if the error was a type hint failure then throw an InvalidArgumentException instead
		elseif( preg_match('/^Argument (\d+) passed to ([\w\\\\]+)::(\w+)\(\) must be an instance of ([\w\\\\]+), ([\w\\\\]+) given, called in ([\w\s\.\/_-]+) on line (\d+)/', $message, $m) )
			throw new \InvalidArgumentException("Argument {$m[1]} to {$m[2]}::{$m[3]}() should be an instance of {$m[4]}, {$m[5]} given", $severity, new \ErrorException($message, 0, $severity, $m[6], $m[7]));

		// convert the error to an exception
		throw new \ErrorException($message, 0, $severity, $file, $line);

	}
public static function error ( $ severity , $ message , $ file , $ line ) { // Latest Twig raises a warning when accessing missing cached views - we can ignore it if ( preg_match ( '/filemtime/' , $ message ) ) return ; // if the error was a type hint failure then throw an InvalidArgumentException instead elseif ( preg_match ( '/^Argument (\d+) passed to ([\w\\\\]+)::(\w+)\(\) must be an instance of ([\w\\\\]+), ([\w\\\\]+) given, called in ([\w\s\.\/_-]+) on line (\d+)/' , $ message , $ m ) ) throw new \ InvalidArgumentException ( "Argument {$m[1]} to {$m[2]}::{$m[3]}() should be an instance of {$m[4]}, {$m[5]} given" , $ severity , new \ ErrorException ( $ message , 0 , $ severity , $ m [ 6 ] , $ m [ 7 ] ) ) ; // convert the error to an exception throw new \ ErrorException ( $ message , 0 , $ severity , $ file , $ line ) ; }
Default error handler - convert errors to ErrorExceptions.
@param int     $severity   the error level (http://php.net/manual/en/errorfunc.constants.php)
@param string  $message
@param string  $file
@param int     $line
@return void
Default error handler - convert errors to ErrorExceptions .