Просмотр исходного кода

Merge pull request #1241 from gmponos/error_handler

Error handler strict comparison fix
Jordi Boggiano 7 лет назад
Родитель
Сommit
5d8db44eea
1 измененных файлов с 2 добавлено и 4 удалено
  1. 2 4
      src/Monolog/ErrorHandler.php

+ 2 - 4
src/Monolog/ErrorHandler.php

@@ -58,9 +58,6 @@ class ErrorHandler
      */
     public static function register(LoggerInterface $logger, $errorLevelMap = [], $exceptionLevelMap = [], $fatalLevel = null): self
     {
-        //Forces the autoloader to run for LogLevel. Fixes an autoload issue at compile-time on PHP5.3. See https://github.com/Seldaek/monolog/pull/929
-        class_exists('\\Psr\\Log\\LogLevel', true);
-
         $handler = new static($logger);
         if ($errorLevelMap !== false) {
             $handler->registerErrorHandler($errorLevelMap);
@@ -150,6 +147,7 @@ class ErrorHandler
 
     /**
      * @private
+     * @param \Exception $e
      */
     public function handleException($e)
     {
@@ -171,7 +169,7 @@ class ErrorHandler
             call_user_func($this->previousExceptionHandler, $e);
         }
 
-        if (!headers_sent() && ini_get('display_errors') === 0) {
+        if (!headers_sent() && !ini_get('display_errors')) {
             http_response_code(500);
         }