From aa3bcf4f7674719df078e61cc8062e5b7f752031 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 28 Feb 2025 23:36:36 +0100 Subject: [PATCH] don't trigger "internal" deprecations for PHPUnit Stub objects --- DebugClassLoader.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/DebugClassLoader.php b/DebugClassLoader.php index b6ad33a..3f2a136 100644 --- a/DebugClassLoader.php +++ b/DebugClassLoader.php @@ -18,6 +18,7 @@ use Phake\IMock; use PHPUnit\Framework\MockObject\Matcher\StatelessInvocation; use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\MockObject\Stub; use Prophecy\Prophecy\ProphecySubjectInterface; use ProxyManager\Proxy\ProxyInterface; use Symfony\Component\DependencyInjection\Argument\LazyClosure; @@ -253,6 +254,7 @@ public static function checkClasses(): bool for (; $i < \count($symbols); ++$i) { if (!is_subclass_of($symbols[$i], MockObject::class) + && !is_subclass_of($symbols[$i], Stub::class) && !is_subclass_of($symbols[$i], ProphecySubjectInterface::class) && !is_subclass_of($symbols[$i], Proxy::class) && !is_subclass_of($symbols[$i], ProxyInterface::class)