diff --git a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php index 9397af1f22799..53f27477d78cc 100644 --- a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php +++ b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php @@ -251,15 +251,16 @@ 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) { - return $previousErrorHandler ? $previousErrorHandler($type, $msg, $file, $line, $context) : false; + 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); }); - // This can be registered before the PHPUnit error handler. - if (!$previousErrorHandler) { - $UtilPrefix = class_exists('PHPUnit_Util_ErrorHandler') ? 'PHPUnit_Util_' : 'PHPUnit\Util\\'; - $previousErrorHandler = $UtilPrefix.'ErrorHandler::handleError'; - } register_shutdown_function(function () use ($outputFile, &$deprecations) { file_put_contents($outputFile, serialize($deprecations));
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: