From b21398fd7b69e6a6d25e9b35b2cd201ec89124c4 Mon Sep 17 00:00:00 2001 From: HypeMC Date: Wed, 1 May 2024 22:12:44 +0200 Subject: [PATCH] [PhpUnitBridge] Fix `DeprecationErrorHandler` with PhpUnit 10 --- DeprecationErrorHandler.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/DeprecationErrorHandler.php b/DeprecationErrorHandler.php index adddfe6..05c67b7 100644 --- a/DeprecationErrorHandler.php +++ b/DeprecationErrorHandler.php @@ -368,6 +368,12 @@ private static function getPhpUnitErrorHandler() if ('PHPUnit\Util\ErrorHandler::handleError' === $eh) { return $eh; + } elseif (ErrorHandler::class === $eh) { + return function (int $errorNumber, string $errorString, string $errorFile, int $errorLine) { + ErrorHandler::instance()($errorNumber, $errorString, $errorFile, $errorLine); + + return true; + }; } foreach (debug_backtrace(\DEBUG_BACKTRACE_PROVIDE_OBJECT | \DEBUG_BACKTRACE_IGNORE_ARGS) as $frame) {