diff --git a/src/Config/Level/CodeQualityLevel.php b/src/Config/Level/CodeQualityLevel.php index cb94c907531..5bb9d58053b 100644 --- a/src/Config/Level/CodeQualityLevel.php +++ b/src/Config/Level/CodeQualityLevel.php @@ -84,7 +84,6 @@ use Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector; use Rector\Renaming\Rector\FuncCall\RenameFunctionRector; use Rector\Strict\Rector\Empty_\DisallowedEmptyRuleFixerRector; -use Rector\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector; /** * Key 0 = level 0 diff --git a/src/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php b/src/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php index 7b9f787f462..091cfc8b759 100644 --- a/src/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php +++ b/src/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php @@ -517,6 +517,8 @@ private function processArray(List_|Array_ $array, MutatingScope $mutatingScope) private function processArrayItem(ArrayItem $arrayItem, MutatingScope $mutatingScope): void { + $arrayItem->setAttribute(AttributeKey::SCOPE, $mutatingScope); + if ($arrayItem->key instanceof Expr) { $arrayItem->key->setAttribute(AttributeKey::SCOPE, $mutatingScope); }