8000 Don't use autoloader in class_exists() check · symfony/symfony@bc777a5 · GitHub
[go: up one dir, main page]

Skip to content

Commit bc777a5

Browse files
alexpottnicolas-grekas
authored andcommitted
Don't use autoloader in class_exists() check
1 parent 8439029 commit bc777a5

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -251,14 +251,13 @@ public static function collectDeprecations($outputFile)
251251
$deprecations = array();
252252
$previousErrorHandler = set_error_handler(function ($type, $msg, $file, $line, $context = array()) use (&$deprecations, &$previousErrorHandler) {
253253
if (E_USER_DEPRECATED !== $type && E_DEPRECATED !== $type) {
254-
// This can be registered before the PHPUnit error handler.
255-
if (!$previousErrorHandler) {
256-
$ErrorHandler = class_exists('PHPUnit_Util_ErrorHandler') ? 'PHPUnit_Util_ErrorHandler' : 'PHPUnit\Util\ErrorHandler';
257-
258-
return $ErrorHandler::handleError($type, $msg, $file, $line, $context);
259-
} else {
254+
if ($previousErrorHandler) {
260255
return $previousErrorHandler($type, $msg, $file, $line, $context);
261256
}
257+
258+
$ErrorHandler = class_exists('PHPUnit_Util_ErrorHandler', false) ? 'PHPUnit_Util_ErrorHandler' : 'PHPUnit\Util\ErrorHandler';
259+
260+
return $ErrorHandler::handleError($type, $msg, $file, $line, $context);
262261
}
263262
$deprecations[] = array(error_reporting(), $msg);
264263
});

0 commit comments

Comments
 (0)
0