1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-12-04 10:18:09 +01:00
PHP-Parser/test/code/formatPreservation/comments.test
2017-11-04 17:56:11 +01:00

29 lines
316 B
Plaintext

Comment changes
-----
<?php
// Test
foo();
-----
$stmts[0]->setAttribute('comments', []);
-----
<?php
foo();
-----
<?php
$foo;
/* bar */
$baz;
-----
$comments = $stmts[1]->getComments();
$comments[] = new Comment("// foo");
$stmts[1]->setAttribute('comments', $comments);
-----
<?php
$foo;
/* bar */
// foo
$baz;