Attributes ----- 42; ----- $attrGroup = new Node\AttributeGroup([ new Node\Attribute(new Node\Name('B'), []), ]); $stmts[0]->attrGroups[] = $attrGroup; $stmts[0]->stmts[0]->attrGroups[] = $attrGroup; $stmts[0]->stmts[0]->params[0]->attrGroups[] = $attrGroup; $stmts[0]->stmts[1]->attrGroups[] = $attrGroup; $stmts[0]->stmts[2]->attrGroups[] = $attrGroup; $stmts[1]->attrGroups[] = $attrGroup; $stmts[2]->attrGroups[] = $attrGroup; $stmts[3]->attrGroups[] = $attrGroup; $stmts[4]->expr->class->attrGroups[] = $attrGroup; $stmts[5]->expr->attrGroups[] = $attrGroup; $stmts[6]->expr->attrGroups[] = $attrGroup; ----- 42; ----- 42; ----- // TODO: Currently we lose formatting for this case. $attrGroup = new Node\AttributeGroup([ new Node\Attribute(new Node\Name('A'), []), ]); $stmts[0]->attrGroups[] = $attrGroup; $stmts[0]->stmts[0]->attrGroups[] = $attrGroup; $stmts[0]->stmts[1]->attrGroups[] = $attrGroup; $stmts[0]->stmts[2]->attrGroups[] = $attrGroup; $stmts[1]->attrGroups[] = $attrGroup; $stmts[2]->attrGroups[] = $attrGroup; $stmts[3]->attrGroups[] = $attrGroup; $stmts[4]->expr->class->attrGroups[] = $attrGroup; $stmts[5]->expr->attrGroups[] = $attrGroup; $stmts[6]->expr->attrGroups[] = $attrGroup; ----- 42; ----- attrGroups[0]->attrs[] = $attr; $stmts[1]->attrGroups[0]->attrs[] = $attr; -----