Skip to content

Commit fd48871

Browse files
committed
Fix build
1 parent 1116e03 commit fd48871

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Type/Php/RangeFunctionReturnTypeExtension.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
use PHPStan\Type\UnionType;
2525
use ValueError;
2626
use function count;
27+
use function is_array;
2728
use function range;
2829

2930
class RangeFunctionReturnTypeExtension implements DynamicFunctionReturnTypeExtension
@@ -71,6 +72,11 @@ public function getTypeFromFunctionCall(FunctionReflection $functionReflection,
7172
} catch (ValueError) {
7273
continue;
7374
}
75+
76+
if (!is_array($rangeValues)) {
77+
continue;
78+
}
79+
7480
if (count($rangeValues) > self::RANGE_LENGTH_THRESHOLD) {
7581
if ($startConstant instanceof ConstantIntegerType && $endConstant instanceof ConstantIntegerType) {
7682
if ($startConstant->getValue() > $endConstant->getValue()) {

0 commit comments

Comments
 (0)