1 Insertion into list nodes
8 $stmts[] = new Stmt\Expression(new Expr\Variable('baz'));
24 $stmts[0]->stmts[] = new Stmt\Expression(new Expr\Variable('baz'));
37 function test(Foo $param1) {}
39 $stmts[0]->params[] = new Node\Param(new Expr\Variable('param2'));
43 function test(Foo $param1, $param2) {}
52 $stmts[0]->catches[0]->types[] = new Node\Name('Bar');
63 function test(Foo $param1) {}
65 array_unshift($stmts[0]->params, new Node\Param(new Expr\Variable('param0')));
69 function test($param0, Foo $param1) {}
75 $stmts[0]->params[] = new Node\Param(new Expr\Variable('param0'));
76 /* Insertion into empty list not handled yet */
80 function test($param0)
90 $stmts[0]->elseifs[] = new Stmt\ElseIf_(new Expr\Variable('cond3'), []);
105 $stmts[0]->catches[] = new Stmt\Catch_([new Node\Name('Bar')], new Expr\Variable('bar'), []);
117 $node = new Stmt\Expression(new Expr\Variable('baz'));
118 $node->setAttribute('comments', [new Comment('// Test')]);
131 $node = new Stmt\Expression(new Expr\Variable('baz'));
132 $node->setAttribute('comments', [new Comment('// Test'), new Comment('// Test 2')]);
133 $stmts[0]->stmts[] = $node;
147 $stmts[0]->name->parts[0] = 'Xyz';
158 $node = new Stmt\Expression(new Expr\Variable('baz'));
159 array_unshift($stmts[0]->stmts, $node);
172 $node = new Stmt\Expression(new Expr\Variable('baz'));
173 $node->setAttribute('comments', [new Comment('// Test')]);
174 array_unshift($stmts[0]->stmts, $node);
190 $node = new Stmt\Expression(new Expr\Variable('baz'));
191 $node->setAttribute('comments', [new Comment('// Test')]);
192 array_unshift($stmts[0]->stmts, $node);
210 $node = new Stmt\Expression(new Expr\Variable('baz'));
211 $node->setAttribute('comments', [new Comment('// Test')]);
212 array_unshift($stmts[0]->stmts, $node);
213 $stmts[0]->stmts[1]->setAttribute('comments', [new Comment('// Bar foo')]);
231 $node = new Stmt\Expression(new Expr\Variable('baz'));
232 $node->setAttribute('comments', [new Comment('// Test')]);
233 array_unshift($stmts[0]->stmts, $node);
234 $stmts[0]->stmts[1]->setAttribute('comments', []);
253 new Stmt\Expression(new Expr\Variable('a')),
254 new Stmt\Expression(new Expr\Variable('b')));
268 /* Insertion into empty list not handled yet */
270 new Stmt\Expression(new Expr\Variable('a')),
271 new Stmt\Expression(new Expr\Variable('b')),
288 array_unshift($stmts[0]->expr->expr->items, new Expr\ArrayItem(new Scalar\LNumber(42)));
289 $stmts[0]->expr->expr->items[] = new Expr\ArrayItem(new Scalar\LNumber(24));
306 $stmts[0]->expr->expr->items[] = new Expr\ArrayItem(new Scalar\LNumber(24));