Skip to content

Commit 552950d

Browse files
Merge branch '5.4' into 6.2
* 5.4: [Console] Fix computing column width containing multibyte chars [Messenger] Fix deprecation layer of RedeliveryStamp [Mime] Form field values with integer keys not resolved correctly [Messenger] [Redis] Fixed problem where worker stops handling messages on first empty message [PHPUnitBridge] Fix PHPUnit 10.1 compatibility [VarDumper] Make the server TCP connection sync [Messenger] Fix warning message on failed messenger show command [Mailer] [Mailjet] Use body MessageID instead of X-MJ-Request-GUID [HttpFoundation] Fix BinaryFileResponse [Form] fix merge [HttpFoundation] Fix memory limit problems in BinaryFileResponse [PropertyAccess] Readonly properties must have no PropertyWriteInfo [Form] Cast choices value callback result to string [Serializer] Unexpected value should throw UnexpectedValueException [ErrorHandler] Don't throw deprecations for HttplugClient [Serializer] Fix denormalization of object with typed constructor arg (not castable) and with COLLECT_DENORMALIZATION_ERRORS Avoid leading .. for temporary files from Filesystem recursive remove
2 parents 56965fa + 1572c5b commit 552950d

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

DeprecationErrorHandler.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
namespace Symfony\Bridge\PhpUnit;
1313

1414
use PHPUnit\Framework\TestResult;
15+
use PHPUnit\Runner\ErrorHandler;
1516
use PHPUnit\Util\Error\Handler;
16-
use PHPUnit\Util\ErrorHandler;
17+
use PHPUnit\Util\ErrorHandler as UtilErrorHandler;
1718
use Symfony\Bridge\PhpUnit\DeprecationErrorHandler\Configuration;
1819
use Symfony\Bridge\PhpUnit\DeprecationErrorHandler\Deprecation;
1920
use Symfony\Bridge\PhpUnit\DeprecationErrorHandler\DeprecationGroup;
@@ -75,7 +76,12 @@ public static function register($mode = 0)
7576
if (null !== $oldErrorHandler) {
7677
restore_error_handler();
7778

78-
if ($oldErrorHandler instanceof ErrorHandler || [ErrorHandler::class, 'handleError'] === $oldErrorHandler) {
79+
if (
80+
$oldErrorHandler instanceof UtilErrorHandler
81+
|| [UtilErrorHandler::class, 'handleError'] === $oldErrorHandler
82+
|| $oldErrorHandler instanceof ErrorHandler
83+
|| [ErrorHandler::class, 'handleError'] === $oldErrorHandler
84+
) {
7985
restore_error_handler();
8086
self::register($mode);
8187
}
@@ -359,6 +365,8 @@ private static function getPhpUnitErrorHandler()
359365
if (!$eh = self::$errorHandler) {
360366
if (class_exists(Handler::class)) {
361367
$eh = self::$errorHandler = Handler::class;
368+
} elseif (method_exists(UtilErrorHandler::class, '__invoke')) {
369+
$eh = self::$errorHandler = UtilErrorHandler::class;
362370
} elseif (method_exists(ErrorHandler::class, '__invoke')) {
363371
$eh = self::$errorHandler = ErrorHandler::class;
364372
} else {

0 commit comments

Comments
 (0)