modifierChange.test 555 B

123456789101112131415161718192021222324252627282930313233
  1. Modifier change
  2. -----
  3. <?php
  4. class Foo {}
  5. abstract class Bar {
  6. const
  7. FOO = 42;
  8. var $foo
  9. = 24;
  10. public function
  11. foo() {}
  12. }
  13. -----
  14. $stmts[0]->flags = Stmt\Class_::MODIFIER_ABSTRACT;
  15. $stmts[1]->flags = 0;
  16. $stmts[1]->stmts[0]->flags = Stmt\Class_::MODIFIER_PRIVATE;
  17. $stmts[1]->stmts[1]->flags = Stmt\Class_::MODIFIER_PROTECTED;
  18. $stmts[1]->stmts[2]->flags |= Stmt\Class_::MODIFIER_FINAL;
  19. -----
  20. <?php
  21. abstract class Foo {}
  22. class Bar {
  23. private const
  24. FOO = 42;
  25. protected $foo
  26. = 24;
  27. public final function
  28. foo() {}
  29. }