php-parser/test/code/formatPreservation/comments.test

29 lines
316 B
Plaintext
Raw Normal View History

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;