Skip to content

Commit 04d9ad8

Browse files
committed
Update ArrayMergeFunctionDynamicReturnTypeExtension.php
1 parent a8f0447 commit 04d9ad8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Type/Php/ArrayMergeFunctionDynamicReturnTypeExtension.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
use PHPStan\Type\TypeCombinator;
2424
use PHPStan\Type\TypeUtils;
2525
use function array_keys;
26+
use function array_values;
2627
use function count;
2728
use function in_array;
2829

@@ -163,7 +164,7 @@ public function getTypeFromFunctionCall(FunctionReflection $functionReflection,
163164
$arrayType = TypeCombinator::intersect($arrayType, new AccessoryArrayListType());
164165
}
165166
if ($offsetTypes !== []) {
166-
$arrayType = TypeCombinator::intersect($arrayType, ...$offsetTypes);
167+
$arrayType = TypeCombinator::intersect($arrayType, ...array_values($offsetTypes));
167168
}
168169

169170
return $arrayType;

0 commit comments

Comments
 (0)