Skip to content

Commit 5b128c4

Browse files
Simplify
1 parent c65ac7f commit 5b128c4

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

src/Reflection/InitializerExprTypeResolver.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,11 +1510,7 @@ public function getPlusTypeFromTypes(Expr $left, Expr $right, Type $leftType, Ty
15101510
// Use the first constant array as a reference to list potential offsets.
15111511
// We only need to check the first array because we're looking for offsets that exist in ALL arrays.
15121512
$constantArray = $leftConstantArrays[0];
1513-
foreach ($constantArray->getKeyTypes() as $i => $offsetType) {
1514-
if ($constantArray->isOptionalKey($i)) {
1515-
continue;
1516-
}
1517-
1513+
foreach ($constantArray->getKeyTypes() as $offsetType) {
15181514
if (!$leftType->hasOffsetValueType($offsetType)->yes()) {
15191515
continue;
15201516
}
@@ -1528,11 +1524,7 @@ public function getPlusTypeFromTypes(Expr $left, Expr $right, Type $leftType, Ty
15281524
// Use the first constant array as a reference to list potential offsets.
15291525
// We only need to check the first array because we're looking for offsets that exist in ALL arrays.
15301526
$constantArray = $rightConstantArrays[0];
1531-
foreach ($constantArray->getKeyTypes() as $i => $offsetType) {
1532-
if ($constantArray->isOptionalKey($i)) {
1533-
continue;
1534-
}
1535-
1527+
foreach ($constantArray->getKeyTypes() as $offsetType) {
15361528
if (!$rightType->hasOffsetValueType($offsetType)->yes()) {
15371529
continue;
15381530
}

0 commit comments

Comments
 (0)