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() );