mirror of
https://github.com/nikic/PHP-Parser.git
synced 2025-04-19 05:30:01 +02:00
Adding a test case for Nop causing bad new statement placement
This commit is contained in:
parent
88f3a669c1
commit
521addec91
20
test/code/formatPreservation/classMethodNop.test
Normal file
20
test/code/formatPreservation/classMethodNop.test
Normal file
@ -0,0 +1,20 @@
|
||||
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
|
||||
$foo;()
|
||||
{
|
||||
// I'm just a comment
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user