Skip to content

Commit 0e92d06

Browse files
committed
Update IntersectionType.php
1 parent 96b6caf commit 0e92d06

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Type/IntersectionType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ public function hasOffsetValueType(Type $offsetType): TrinaryLogic
846846
if ($size instanceof IntegerRangeType && $size->getMin() !== null) {
847847
$knownOffsets = IntegerRangeType::fromInterval(0, $size->getMin() - 1);
848848
} elseif ($size instanceof ConstantIntegerType) {
849-
$knownOffsets = IntegerRangeType::fromInterval(0, $size->getValue());
849+
$knownOffsets = IntegerRangeType::fromInterval(0, $size->getValue() - 1);
850850
} elseif ($this->isIterableAtLeastOnce()->yes()) {
851851
$knownOffsets = new ConstantIntegerType(0);
852852
} else {

0 commit comments

Comments
 (0)