Skip to content

Commit da0f514

Browse files
committed
simplify
1 parent 9dfe8a5 commit da0f514

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

src/Analyser/NodeScopeResolver.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4546,12 +4546,11 @@ private function inferForLoopExpressions(For_ $stmt, Expr $lastCondExpr, Mutatin
45464546
) {
45474547
$arrayArg = $lastCondExpr->right->getArgs()[0]->value;
45484548
$arrayType = $bodyScope->getType($arrayArg);
4549-
$arrayNativeType = $bodyScope->getNativeType($arrayArg);
4550-
if ($arrayType->isList()->yes() || $arrayNativeType->isList()->yes()) {
4549+
if ($arrayType->isList()->yes()) {
45514550
$bodyScope = $bodyScope->assignExpression(
45524551
new ArrayDimFetch($lastCondExpr->right->getArgs()[0]->value, $lastCondExpr->left),
45534552
$arrayType->getIterableValueType(),
4554-
$arrayNativeType->getIterableValueType(),
4553+
$bodyScope->getNativeType($arrayArg)->getIterableValueType(),
45554554
);
45564555
}
45574556
}
@@ -4571,12 +4570,11 @@ private function inferForLoopExpressions(For_ $stmt, Expr $lastCondExpr, Mutatin
45714570
) {
45724571
$arrayArg = $lastCondExpr->left->getArgs()[0]->value;
45734572
$arrayType = $bodyScope->getType($arrayArg);
4574-
$arrayNativeType = $bodyScope->getNativeType($arrayArg);
4575-
if ($arrayType->isList()->yes() || $arrayNativeType->isList()->yes()) {
4573+
if ($arrayType->isList()->yes()) {
45764574
$bodyScope = $bodyScope->assignExpression(
45774575
new ArrayDimFetch($lastCondExpr->left->getArgs()[0]->value, $lastCondExpr->right),
45784576
$arrayType->getIterableValueType(),
4579-
$arrayNativeType->getIterableValueType(),
4577+
$bodyScope->getNativeType($arrayArg)->getIterableValueType(),
45804578
);
45814579
}
45824580
}

0 commit comments

Comments
 (0)