1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-12 01:09:38 +01:00

allow range int to be positive

This commit is contained in:
orklah 2021-09-05 00:24:06 +02:00
parent ea80373006
commit ba7f2a5b3b

View File

@ -74,6 +74,14 @@ class ArrayFillReturnTypeProvider implements \Psalm\Plugin\EventHandler\Function
return true;
}
if ($arg->isSingle()) {
foreach ($arg->getRangeInts() as $range_int) {
if ($range_int->isPositive()) {
return true;
}
}
}
return $arg->isSingleIntLiteral() && $arg->getSingleIntLiteral()->value > 0;
}
}