We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ce026a8 commit c7174a8Copy full SHA for c7174a8
src/Analyser/TypeSpecifier.php
@@ -1063,12 +1063,12 @@ private function specifyTypesForCountFuncCall(
1063
1064
$isConstantArray = $type->isConstantArray();
1065
$isList = $type->isList();
1066
- $positiveInt = IntegerRangeType::fromInterval(1, null);
+ $zeroOrMore = IntegerRangeType::fromInterval(0, null);
1067
if (
1068
!$isNormalCount->yes()
1069
|| (!$isConstantArray->yes() && !$isList->yes())
1070
|| $type->isIterableAtLeastOnce()->no() // array{} cannot be used for further narrowing
1071
- || !$positiveInt->isSuperTypeOf($sizeType)->yes()
+ || !$zeroOrMore->isSuperTypeOf($sizeType)->yes()
1072
) {
1073
return null;
1074
}
0 commit comments