Skip to content

Commit 1f78dac

Browse files
authored
Fix error in PregMatchTypeSpecifyingExtension (#28)
1 parent 59a4eec commit 1f78dac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/PHPStan/PregMatchTypeSpecifyingExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,15 @@ public function specifyTypes(MethodReflection $methodReflection, StaticCall $nod
7575

7676
if (
7777
in_array($methodReflection->getName(), ['matchStrictGroups', 'isMatchStrictGroups'], true)
78-
&& count($matchedType->getConstantArrays()) > 0
78+
&& count($matchedType->getConstantArrays()) === 1
7979
) {
8080
$matchedType = $matchedType->getConstantArrays()[0];
8181
$matchedType = new ConstantArrayType(
8282
$matchedType->getKeyTypes(),
8383
array_map(static function (Type $valueType): Type {
8484
return TypeCombinator::removeNull($valueType);
8585
}, $matchedType->getValueTypes()),
86-
[0],
86+
$matchedType->getNextAutoIndexes(),
8787
[],
8888
$matchedType->isList()
8989
);

0 commit comments

Comments
 (0)