菜谱项目

NamespaceCoveredClass.php 603B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace Foo;
  3. class CoveredParentClass
  4. {
  5. private function privateMethod()
  6. {
  7. }
  8. protected function protectedMethod()
  9. {
  10. $this->privateMethod();
  11. }
  12. public function publicMethod()
  13. {
  14. $this->protectedMethod();
  15. }
  16. }
  17. class CoveredClass extends CoveredParentClass
  18. {
  19. private function privateMethod()
  20. {
  21. }
  22. protected function protectedMethod()
  23. {
  24. parent::protectedMethod();
  25. $this->privateMethod();
  26. }
  27. public function publicMethod()
  28. {
  29. parent::publicMethod();
  30. $this->protectedMethod();
  31. }
  32. }