Skip to content

Commit fa9629d

Browse files
committed
improve naming
1 parent 3f1cbc1 commit fa9629d

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/Analyser/ExprHandler/AssignHandler.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -983,8 +983,15 @@ private function produceArrayDimFetchAssignValueToWrite(array $dimFetchStack, ar
983983
}
984984

985985
} else {
986-
$unionValues = $i === 0;
987-
if (!$unionValues && $i === $lastOffsetIndex && $offsetType !== null) {
986+
$isLastDimFetchInChain = $i === 0;
987+
$isFirstDimFetchInChain = $i === $lastOffsetIndex;
988+
989+
$unionValues = $isLastDimFetchInChain;
990+
if (
991+
!$isLastDimFetchInChain
992+
&& $isFirstDimFetchInChain
993+
&& $offsetType !== null
994+
) {
988995
$unionValues = $this->shouldUnionExistingItemType($offsetValueType, $valueToWrite);
989996
}
990997
$valueToWrite = $offsetValueType->setOffsetValueType($offsetType, $valueToWrite, $unionValues);

0 commit comments

Comments
 (0)