Skip to content

Commit b854fbf

Browse files
committed
Don't overwrite $offsetType
1 parent 6ae63c8 commit b854fbf

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/Type/Constant/ConstantArrayType.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -701,9 +701,7 @@ public function getOffsetValueType(Type $offsetType): Type
701701
public function setOffsetValueType(?Type $offsetType, Type $valueType, bool $unionValues = true): Type
702702
{
703703
if ($offsetType !== null) {
704-
$offsetType = $offsetType->toArrayKey();
705-
706-
$scalarKeyTypes = $offsetType->getConstantStrings();
704+
$scalarKeyTypes = $offsetType->toArrayKey()->getConstantStrings();
707705
if (count($scalarKeyTypes) === 0) {
708706
$integerRanges = TypeUtils::getIntegerRanges($offsetType);
709707
if (count($integerRanges) > 0) {

0 commit comments

Comments
 (0)