From dcec747b82f4f3b0db4fd9f115bcb749646c5e43 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 16 May 2026 15:06:38 +0000 Subject: [PATCH] Fix InspectorTypeExtensionTest failure with PHPStan HEAD PHPStan HEAD no longer infers mixed~null (introduced in 2.1.47) in this scope after reassigning $array. Revert the fixture expectation to mixed. The instanceof MixedType check in InspectorTypeExtension::specifyAssertAll() remains correct as it handles both mixed and mixed~null inputs. https://claude.ai/code/session_01HQDbrBSq6Hs6sZNLpZGq5z --- tests/src/Type/data/bug-857.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/src/Type/data/bug-857.php b/tests/src/Type/data/bug-857.php index a386a2a1..43d48c89 100644 --- a/tests/src/Type/data/bug-857.php +++ b/tests/src/Type/data/bug-857.php @@ -14,7 +14,7 @@ function mixed_function(): mixed {} // If the type is narrowed before '::assertAll()', it shouldn't change it. $array = mixed_function(); -assertType('mixed~null', $array); +assertType('mixed', $array); \assert(Inspector::assertAllArrays($array)); assertType('iterable', $array); \assert(Inspector::assertAll(fn (array $i): bool => TRUE, $array));