From 884429f0439231f0817cd070f9212b38317a5783 Mon Sep 17 00:00:00 2001 From: PrinsFrank <25006490+PrinsFrank@users.noreply.github.com> Date: Wed, 20 Aug 2025 21:25:45 +0200 Subject: [PATCH] Update RangeFunctionReturnTypeExtension to include known integer ranges --- src/Type/Php/RangeFunctionReturnTypeExtension.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Type/Php/RangeFunctionReturnTypeExtension.php b/src/Type/Php/RangeFunctionReturnTypeExtension.php index de6e43bd79..45bc460aa1 100644 --- a/src/Type/Php/RangeFunctionReturnTypeExtension.php +++ b/src/Type/Php/RangeFunctionReturnTypeExtension.php @@ -93,7 +93,7 @@ public function getTypeFromFunctionCall(FunctionReflection $functionReflection, } return TypeCombinator::intersect( new ArrayType( - new IntegerType(), + IntegerRangeType::fromInterval(0, (int) (($endConstant->getValue() - $startConstant->getValue()) / $stepConstant->getValue())), IntegerRangeType::fromInterval($startConstant->getValue(), $endConstant->getValue()), ), new NonEmptyArrayType(),