1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- Adding statement to Class Method containing Nop
- -----
- <?php
- class Foo {
- public function __construct()
- {
- // I'm just a comment
- }
- }
- -----
- $stmts[0]->stmts[0]->stmts[] = new Stmt\Expression(new Node\Expr\Variable('foo'));
- -----
- <?php
- class Foo {
- public function __construct()
- {
- // I'm just a comment
- $foo;
- }
- }
- -----
- <?php
- class Foo {
- public function __construct()
- {
- /* I'm just a comment */
- }
- }
- -----
- $stmts[0]->stmts[0]->stmts[] = new Stmt\Expression(new Node\Expr\Variable('foo'));
- -----
- <?php
- class Foo {
- public function __construct()
- {
- /* I'm just a comment */
- $foo;
- }
- }
- -----
- <?php
- class Foo {
- public function __construct()
- {
- /* I'm just a comment */
- }
- }
- -----
- $stmts[0]->stmts[0]->stmts[0]->setAttribute('comments', [new Comment("/* I'm a new comment */")]);
- -----
- <?php
- class Foo {
- public function __construct()
- {
- /* I'm a new comment */
- }
- }
- -----
- <?php
- class Foo {
- public function __construct()
- {
- // I'm just a comment
- }
- }
- -----
- $stmts[0]->stmts[0]->stmts[0]->setAttribute('comments', [new Comment("// I'm a new comment\n")]);
- -----
- <?php
- class Foo {
- public function __construct()
- {
- // I'm a new comment
- }
- }
|