comments.test 668 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. Comment changes
  2. -----
  3. <?php
  4. // Test
  5. foo();
  6. -----
  7. $stmts[0]->setAttribute('comments', []);
  8. -----
  9. <?php
  10. foo();
  11. -----
  12. <?php
  13. $foo;
  14. /* bar */
  15. $baz;
  16. -----
  17. $comments = $stmts[1]->getComments();
  18. $comments[] = new Comment("// foo");
  19. $stmts[1]->setAttribute('comments', $comments);
  20. -----
  21. <?php
  22. $foo;
  23. /* bar */
  24. // foo
  25. $baz;
  26. -----
  27. <?php
  28. class Test {
  29. /**
  30. * @expectedException \FooException
  31. */
  32. public function test() {
  33. // some code
  34. }
  35. }
  36. -----
  37. $method = $stmts[0]->stmts[0];
  38. $method->setAttribute('comments', [new Comment\Doc("/**\n *\n */")]);
  39. -----
  40. <?php
  41. class Test {
  42. /**
  43. *
  44. */
  45. public function test() {
  46. // some code
  47. }
  48. }