Skip to content

Commit a4f3867

Browse files
authored
Merge branch refs/heads/2.1.x into 2.2.x
2 parents d7b343c + d462113 commit a4f3867

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/Analyser/MutatingScope.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,8 +1467,6 @@ private function resolveType(string $exprString, Expr $node): Type
14671467
$node->var,
14681468
$this->getTypeFromArrayDimFetch(
14691469
$node,
1470-
$this->getType($node->dim),
1471-
$this->getType($node->var),
14721470
),
14731471
);
14741472
}
@@ -1845,14 +1843,13 @@ private function promoteNativeTypes(): self
18451843

18461844
private function getTypeFromArrayDimFetch(
18471845
Expr\ArrayDimFetch $arrayDimFetch,
1848-
Type $offsetType,
1849-
Type $offsetAccessibleType,
18501846
): Type
18511847
{
18521848
if ($arrayDimFetch->dim === null) {
18531849
throw new ShouldNotHappenException();
18541850
}
18551851

1852+
$offsetAccessibleType = $this->getType($arrayDimFetch->var);
18561853
if ($offsetAccessibleType instanceof NeverType) {
18571854
return $offsetAccessibleType;
18581855
}
@@ -1872,6 +1869,7 @@ private function getTypeFromArrayDimFetch(
18721869
);
18731870
}
18741871

1872+
$offsetType = $this->getType($arrayDimFetch->dim);
18751873
return $offsetAccessibleType->getOffsetValueType($offsetType);
18761874
}
18771875

0 commit comments

Comments
 (0)