8000 Fix isolated error handling by alexpott · Pull Request #24681 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Fix isolated error handling #24681

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Don't use autoloader in class_exists() check
  • Loading branch information
alexpott authored and nicolas-grekas committed Oct 25, 2017
commit bc777a5bce0fe9c7792d2ab92b355d4b0744bd18
11 changes: 5 additions & 6 deletions src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,14 +251,13 @@ public static function collectDeprecations($outputFile)
$deprecations = array();
$previousErrorHandler = set_error_handler(function ($type, $msg, $file, $line, $context = array()) use (&$deprecations, &$previousErrorHandler) {
if (E_USER_DEPRECATED !== $type && E_DEPRECATED !== $type) {
// This can be registered before the PHPUnit error handler.
if (!$previousErrorHandler) {
$ErrorHandler = class_exists('PHPUnit_Util_ErrorHandler') ? 'PHPUnit_Util_ErrorHandler' : 'PHPUnit\Util\ErrorHandler';

return $ErrorHandler::handleError($type, $msg, $file, $line, $context);
} else {
if ($previousErrorHandler) {
return $previousErrorHandler($type, $msg, $file, $line, $context);
}

$ErrorHandler = class_exists('PHPUnit_Util_ErrorHandler', false) ? 'PHPUnit_Util_ErrorHandler' : 'PHPUnit\Util\ErrorHandler';

return $ErrorHandler::handleError($type, $msg, $file, $line, $context);
}
$deprecations[] = array(error_reporting(), $msg);
});
Expand Down
0