Skip to content

Commit ea5089e

Browse files
Fix ArrayItem scope filling on Foreach_ value (#7858)
* Fix ArrayItem scope filling on Foreach_ value * [ci-review] Rector Rectify --------- Co-authored-by: GitHub Action <actions@github.com>
1 parent b855ff8 commit ea5089e

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

‎src/Config/Level/CodeQualityLevel.php‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@
8484
use Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector;
8585
use Rector\Renaming\Rector\FuncCall\RenameFunctionRector;
8686
use Rector\Strict\Rector\Empty_\DisallowedEmptyRuleFixerRector;
87-
use Rector\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector;
8887

8988
/**
9089
* Key 0 = level 0

‎src/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,8 @@ private function processArray(List_|Array_ $array, MutatingScope $mutatingScope)
517517

518518
private function processArrayItem(ArrayItem $arrayItem, MutatingScope $mutatingScope): void
519519
{
520+
$arrayItem->setAttribute(AttributeKey::SCOPE, $mutatingScope);
521+
520522
if ($arrayItem->key instanceof Expr) {
521523
$arrayItem->key->setAttribute(AttributeKey::SCOPE, $mutatingScope);
522524
}

0 commit comments

Comments
 (0)