2020-01-31 17:14:25 +01:00
|
|
|
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 {
|
2020-02-09 16:17:12 +01:00
|
|
|
public function __construct()
|
2020-01-31 17:14:25 +01:00
|
|
|
{
|
|
|
|
// I'm just a comment
|
2020-06-27 18:53:09 +02:00
|
|
|
$foo;
|
|
|
|
}
|
2020-02-09 17:10:33 +01:00
|
|
|
}
|
|
|
|
-----
|
|
|
|
<?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;
|
|
|
|
}
|
2020-02-09 17:23:42 +01:00
|
|
|
}
|
|
|
|
-----
|
|
|
|
<?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
|
2020-06-27 18:53:09 +02:00
|
|
|
|
|
|
|
}
|
2020-01-31 17:14:25 +01:00
|
|
|
}
|