Browse Source

Refactor the ignored error logging.

Taylor Otwell 13 years ago
parent
commit
fc8b30159e
1 changed files with 8 additions and 9 deletions
  1. 8 9
      laravel/laravel.php

+ 8 - 9
laravel/laravel.php

@@ -72,18 +72,17 @@ set_exception_handler(function($exception) use ($handler)
  * errors are ignored and errors in the developer configured whitelist
  * are silently logged.
  */
-set_error_handler(function($number, $error, $file, $line) use ($logger)
+set_error_handler(function($code, $error, $file, $line) use ($logger)
 {
-	if (error_reporting() === 0)
-	{
-		return;
-	}
-	$exception =  new \ErrorException($error, $number, 0, $file, $line);
-	if (in_array($number, Config::$items['error']['ignore']))
+	if (error_reporting() === 0) return;
+
+	$exception = new \ErrorException($error, $code, 0, $file, $line);
+
+	if (in_array($code, Config::$items['error']['ignore']))
 	{
-		$logger($exception);
-		return;
+		return $logger($exception);
 	}
+
 	throw $exception;
 });