From af50d23e2669a255a290911cc3137fc0f07fad4c Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Thu, 11 Jul 2024 16:37:41 +0200 Subject: [PATCH] Fix error in PregMatchTypeSpecifyingExtension --- src/PHPStan/PregMatchTypeSpecifyingExtension.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PHPStan/PregMatchTypeSpecifyingExtension.php b/src/PHPStan/PregMatchTypeSpecifyingExtension.php index d441f11..af7700b 100644 --- a/src/PHPStan/PregMatchTypeSpecifyingExtension.php +++ b/src/PHPStan/PregMatchTypeSpecifyingExtension.php @@ -75,7 +75,7 @@ public function specifyTypes(MethodReflection $methodReflection, StaticCall $nod if ( in_array($methodReflection->getName(), ['matchStrictGroups', 'isMatchStrictGroups'], true) - && count($matchedType->getConstantArrays()) > 0 + && count($matchedType->getConstantArrays()) === 1 ) { $matchedType = $matchedType->getConstantArrays()[0]; $matchedType = new ConstantArrayType( @@ -83,7 +83,7 @@ public function specifyTypes(MethodReflection $methodReflection, StaticCall $nod array_map(static function (Type $valueType): Type { return TypeCombinator::removeNull($valueType); }, $matchedType->getValueTypes()), - [0], + $matchedType->getNextAutoIndexes(), [], $matchedType->isList() );