toplevel.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <?php
  2. use mindplay\test\traits\AliasTrait;
  3. use mindplay\test\traits\InsteadofTraitA;
  4. /**
  5. * @note('simple-trait')
  6. */
  7. trait SimpleTrait
  8. {
  9. /**
  10. * @note('simple-trait')
  11. */
  12. protected $sampleFromTrait = 'test';
  13. /**
  14. * @Note('simple-trait')
  15. */
  16. public function runFromTrait()
  17. {
  18. }
  19. }
  20. class SimpleTraitTester
  21. {
  22. use SimpleTrait, mindplay\test\traits\AnotherSimpleTrait;
  23. }
  24. trait InheritanceBaseTrait
  25. {
  26. /**
  27. * @Note('inheritance-base-trait')
  28. */
  29. public function traitAndParent()
  30. {
  31. }
  32. /**
  33. * @Note('inheritance-base-trait')
  34. */
  35. public function baseTraitAndParent()
  36. {
  37. }
  38. }
  39. trait InheritanceTrait
  40. {
  41. use InheritanceBaseTrait;
  42. /**
  43. * @Note('inheritance-trait')
  44. */
  45. public function traitAndParent()
  46. {
  47. }
  48. /**
  49. * @Note('inheritance-trait')
  50. */
  51. public function traitAndChild()
  52. {
  53. }
  54. /**
  55. * @Note('inheritance-trait')
  56. */
  57. public function traitAndParentAndChild()
  58. {
  59. }
  60. }
  61. class InheritanceBaseTraitTester
  62. {
  63. /**
  64. * @Note('inheritance-base-trait-tester')
  65. */
  66. public function baseTraitAndParent()
  67. {
  68. }
  69. /**
  70. * @Note('inheritance-base-trait-tester')
  71. */
  72. public function traitAndParent()
  73. {
  74. }
  75. /**
  76. * @Note('inheritance-base-trait-tester')
  77. */
  78. public function traitAndParentAndChild()
  79. {
  80. }
  81. }
  82. class InheritanceTraitTester extends InheritanceBaseTraitTester
  83. {
  84. use InheritanceTrait;
  85. /**
  86. * @Note('inheritance-trait-tester')
  87. */
  88. public function traitAndChild()
  89. {
  90. }
  91. /**
  92. * @Note('inheritance-trait-tester')
  93. */
  94. public function traitAndParentAndChild()
  95. {
  96. }
  97. }
  98. class AliasBaseTraitTester
  99. {
  100. /**
  101. * @Note('alias-base-trait-tester')
  102. */
  103. public function baseTraitRun()
  104. {
  105. }
  106. /**
  107. * @Note('alias-base-trait-tester')
  108. */
  109. public function traitRun()
  110. {
  111. }
  112. /**
  113. * @Note('alias-base-trait-tester')
  114. */
  115. public function run()
  116. {
  117. }
  118. }
  119. class AliasTraitTester extends AliasBaseTraitTester
  120. {
  121. use AliasTrait {
  122. AliasTrait::run as traitRun;
  123. }
  124. /**
  125. * @Note('alias-trait-tester')
  126. */
  127. public function run()
  128. {
  129. }
  130. }
  131. class InsteadofBaseTraitTester
  132. {
  133. /**
  134. * @Note('insteadof-base-trait-tester')
  135. */
  136. public function trate()
  137. {
  138. }
  139. /**
  140. * @Note('insteadof-base-trait-tester')
  141. */
  142. public function baseTrait()
  143. {
  144. }
  145. }
  146. class InsteadofTraitTester extends InsteadofBaseTraitTester
  147. {
  148. use InsteadofTraitA, mindplay\test\traits\InsteadofTraitB {
  149. InsteadofTraitA::trate insteadof mindplay\test\traits\InsteadofTraitB;
  150. mindplay\test\traits\InsteadofTraitB::baseTrait insteadof InsteadofTraitA;
  151. }
  152. }