trait.test 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. Traits
  2. -----
  3. <?php
  4. trait A {
  5. public function a() {}
  6. }
  7. class B {
  8. use C;
  9. use D {
  10. a as protected b;
  11. c as d;
  12. e as private;
  13. }
  14. use E, F, G {
  15. E::a insteadof F, G;
  16. E::b as protected c;
  17. E::d as e;
  18. E::f as private;
  19. }
  20. }
  21. -----
  22. array(
  23. 0: Stmt_Trait(
  24. name: A
  25. stmts: array(
  26. 0: Stmt_ClassMethod(
  27. type: 1
  28. byRef: false
  29. params: array(
  30. )
  31. stmts: array(
  32. )
  33. name: a
  34. )
  35. )
  36. )
  37. 1: Stmt_Class(
  38. type: 0
  39. extends: null
  40. implements: array(
  41. )
  42. stmts: array(
  43. 0: Stmt_TraitUse(
  44. traits: array(
  45. 0: Name(
  46. parts: array(
  47. 0: C
  48. )
  49. )
  50. )
  51. adaptations: array(
  52. )
  53. )
  54. 1: Stmt_TraitUse(
  55. traits: array(
  56. 0: Name(
  57. parts: array(
  58. 0: D
  59. )
  60. )
  61. )
  62. adaptations: array(
  63. 0: Stmt_TraitUseAdaptation_Alias(
  64. trait: null
  65. method: a
  66. newModifier: 2
  67. newName: b
  68. )
  69. 1: Stmt_TraitUseAdaptation_Alias(
  70. trait: null
  71. method: c
  72. newModifier: null
  73. newName: d
  74. )
  75. 2: Stmt_TraitUseAdaptation_Alias(
  76. trait: null
  77. method: e
  78. newModifier: 4
  79. newName: null
  80. )
  81. )
  82. )
  83. 2: Stmt_TraitUse(
  84. traits: array(
  85. 0: Name(
  86. parts: array(
  87. 0: E
  88. )
  89. )
  90. 1: Name(
  91. parts: array(
  92. 0: F
  93. )
  94. )
  95. 2: Name(
  96. parts: array(
  97. 0: G
  98. )
  99. )
  100. )
  101. adaptations: array(
  102. 0: Stmt_TraitUseAdaptation_Precedence(
  103. trait: Name(
  104. parts: array(
  105. 0: E
  106. )
  107. )
  108. method: a
  109. insteadof: array(
  110. 0: Name(
  111. parts: array(
  112. 0: F
  113. )
  114. )
  115. 1: Name(
  116. parts: array(
  117. 0: G
  118. )
  119. )
  120. )
  121. )
  122. 1: Stmt_TraitUseAdaptation_Alias(
  123. trait: Name(
  124. parts: array(
  125. 0: E
  126. )
  127. )
  128. method: b
  129. newModifier: 2
  130. newName: c
  131. )
  132. 2: Stmt_TraitUseAdaptation_Alias(
  133. trait: Name(
  134. parts: array(
  135. 0: E
  136. )
  137. )
  138. method: d
  139. newModifier: null
  140. newName: e
  141. )
  142. 3: Stmt_TraitUseAdaptation_Alias(
  143. trait: Name(
  144. parts: array(
  145. 0: E
  146. )
  147. )
  148. method: f
  149. newModifier: 4
  150. newName: null
  151. )
  152. )
  153. )
  154. )
  155. name: B
  156. )
  157. )