Skip to content

Commit

Permalink
Fixed error handler to respect current error_reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
JanJakes authored and keradus committed Jun 12, 2015
1 parent a950c2f commit c2e9f6b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Symfony/CS/Resources/phar-stub.php
Expand Up @@ -21,7 +21,9 @@
}

set_error_handler(function ($severity, $message, $file, $line) {
throw new ErrorException($message, 0, $severity, $file, $line);
if ($severity & error_reporting()) {
throw new ErrorException($message, 0, $severity, $file, $line);
}
});

Phar::mapPhar('php-cs-fixer.phar');
Expand Down
4 changes: 3 additions & 1 deletion php-cs-fixer
Expand Up @@ -26,7 +26,9 @@ if (defined('HHVM_VERSION_ID')) {
}

set_error_handler(function ($severity, $message, $file, $line) {
throw new ErrorException($message, 0, $severity, $file, $line);
if ($severity & error_reporting()) {
throw new ErrorException($message, 0, $severity, $file, $line);
}
});

// installed via composer?
Expand Down

0 comments on commit c2e9f6b

Please sign in to comment.