Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 884429f

Browse files
Update RangeFunctionReturnTypeExtension to include known integer ranges
1 parent dba6c24 commit 884429f

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-
newIntegerType(),
96+
IntegerRangeType::fromInterval(0, (int) (($endConstant->getValue() - $startConstant->getValue()) / $stepConstant->getValue())),
9797
IntegerRangeType::fromInterval($startConstant->getValue(), $endConstant->getValue()),
9898
),
9999
new NonEmptyArrayType(),

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /