getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::PARENT_NODE); if ($parent instanceof \PhpParser\Node\Stmt\Return_) { return \true; } if ($parent instanceof \PhpParser\Node\Arg) { return \true; } if ($parent instanceof \PhpParser\Node\Expr\ArrayDimFetch) { $parentParent = $parent->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::PARENT_NODE); if (!$parentParent instanceof \PhpParser\Node\Expr\Assign) { return \true; } return $parentParent->var !== $parent; } // assume it's used by default return !$parent instanceof \PhpParser\Node\Stmt\Expression; } }