Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: symfony/phpunit-bridge
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v5.4.21
Choose a base ref
...
head repository: symfony/phpunit-bridge
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v5.4.23
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Apr 18, 2023

  1. Copy the full SHA
    1572c5b View commit details
Showing with 10 additions and 2 deletions.
  1. +10 −2 DeprecationErrorHandler.php
12 changes: 10 additions & 2 deletions DeprecationErrorHandler.php
Original file line number Diff line number Diff line change
@@ -12,8 +12,9 @@
namespace Symfony\Bridge\PhpUnit;

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

if ($oldErrorHandler instanceof ErrorHandler || [ErrorHandler::class, 'handleError'] === $oldErrorHandler) {
if (
$oldErrorHandler instanceof UtilErrorHandler
|| [UtilErrorHandler::class, 'handleError'] === $oldErrorHandler
|| $oldErrorHandler instanceof ErrorHandler
|| [ErrorHandler::class, 'handleError'] === $oldErrorHandler
) {
restore_error_handler();
self::register($mode);
}
@@ -351,6 +357,8 @@ private static function getPhpUnitErrorHandler()
if (!$eh = self::$errorHandler) {
if (class_exists(Handler::class)) {
$eh = self::$errorHandler = Handler::class;
} elseif (method_exists(UtilErrorHandler::class, '__invoke')) {
$eh = self::$errorHandler = UtilErrorHandler::class;
} elseif (method_exists(ErrorHandler::class, '__invoke')) {
$eh = self::$errorHandler = ErrorHandler::class;
} else {