mirror of
https://github.com/danog/PHP-Parser.git
synced 2024-12-04 10:18:09 +01:00
46cbd9393a
If the Nop is created to collect comments, place it directly after the comment, instead of at the next non-whitespace character.
39 lines
667 B
Plaintext
39 lines
667 B
Plaintext
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;
|
|
}
|
|
} |