Removing from list nodes ----- params); ----- params); $stmts[0]->params[] = new Node\Param(new Expr\Variable('x')); $stmts[0]->params[] = new Node\Param(new Expr\Variable('y')); ----- returnType->types); ----- catches[2]; unset($stmts[0]->catches[2]); $stmts[0]->catches = array_values($stmts[0]->catches); array_splice($stmts[0]->catches, 1, 0, [$catch]); ----- catches[2]); $stmts[0]->catches = array_values($stmts[0]->catches); ----- stmts[2] = new Node\Stmt\ClassMethod('getBar'); $stmts[0]->stmts[3] = new Node\Stmt\ClassMethod('getBaz'); ----- stmts[0]->traits[0]); -----