From ce2b8c51c2cc100022837a2df09dc7e3bf9308bd Mon Sep 17 00:00:00 2001 From: Maurice Busch Date: Wed, 2 Sep 2026 08:50:00 +0200 Subject: [PATCH] fix: pass null to ReflectionProperty::setValue() for static Assert::$count Execution::resetAssertions() passed Assert::class as the first argument of ReflectionProperty::setValue(). For a static property PHP 8.3 deprecates any first argument that is not null or an object: Calling ReflectionProperty::setValue() with a 1st argument which is not null or an object is deprecated It fires whenever an assertion retries, so it attaches to an arbitrary test -- usually a slow one -- and labels it DEPRECATED while the run still exits 0. The single-argument form setValue($value) is deprecated as well on 8.4 ("Calling ReflectionProperty::setValue() with a single argument is deprecated"), so null as the first argument is the only spelling that is clean. The @phpstan-ignore-next-line has to go with it: phpstan.neon sets reportUnmatchedIgnoredErrors: true, and the corrected call raises nothing for it to match. Co-Authored-By: Claude Opus 5 --- src/Execution.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Execution.php b/src/Execution.php index 7ffc945d..a3ebc01c 100644 --- a/src/Execution.php +++ b/src/Execution.php @@ -171,7 +171,6 @@ private function resetAssertions(int $originalCount): void $reflector = new ReflectionClass(Assert::class); $property = $reflector->getProperty('count'); - // @phpstan-ignore-next-line - $property->setValue(Assert::class, $originalCount); + $property->setValue(null, $originalCount); } }