Skip to content

Commit 783dac8

Browse files
committed
Update RangeFunctionReturnTypeExtension to include known integer ranges
1 parent dba6c24 commit 783dac8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Type/Php/RangeFunctionReturnTypeExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function getTypeFromFunctionCall(FunctionReflection $functionReflection,
9393
}
9494
return TypeCombinator::intersect(
9595
new ArrayType(
96-
new IntegerType(),
96+
IntegerRangeType::fromInterval(0, ($endConstant->getValue() - $startConstant->getValue()) / $stepConstant->getValue()),
9797
IntegerRangeType::fromInterval($startConstant->getValue(), $endConstant->getValue()),
9898
),
9999
new NonEmptyArrayType(),

0 commit comments

Comments
 (0)