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:
parent
ea80373006
commit
ba7f2a5b3b
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user