removalViaNull.test 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. Removing subnodes by setting them to null
  2. -----
  3. <?php
  4. function
  5. foo (
  6. Bar $foo
  7. = null,
  8. Foo $bar) : baz
  9. {}
  10. function
  11. ()
  12. : int
  13. {};
  14. class
  15. Foo
  16. extends
  17. Bar
  18. {
  19. public
  20. function
  21. foo() : ?X {}
  22. public
  23. $prop = 'x'
  24. ;
  25. use T {
  26. T
  27. ::
  28. x
  29. as
  30. public
  31. y
  32. ;
  33. }
  34. const
  35. int
  36. X
  37. = 1;
  38. }
  39. $foo [ $bar ];
  40. exit ( $bar );
  41. $foo
  42. ? $bar :
  43. $baz;
  44. [ $a => $b
  45. , $c => $d];
  46. yield
  47. $foo
  48. =>
  49. $bar;
  50. yield
  51. $bar;
  52. break
  53. 2
  54. ;
  55. continue
  56. 2
  57. ;
  58. foreach(
  59. $array
  60. as
  61. $key
  62. =>
  63. $value
  64. ) {}
  65. if
  66. ($x)
  67. {
  68. }
  69. else {}
  70. return
  71. $val
  72. ;
  73. static
  74. $x
  75. =
  76. $y
  77. ;
  78. try {} catch
  79. (X $y)
  80. {}
  81. finally
  82. {}
  83. -----
  84. $stmts[0]->returnType = null;
  85. $stmts[0]->params[0]->default = null;
  86. $stmts[0]->params[1]->type = null;
  87. $stmts[1]->expr->returnType = null;
  88. $stmts[2]->extends = null;
  89. $stmts[2]->stmts[0]->returnType = null;
  90. $stmts[2]->stmts[1]->props[0]->default = null;
  91. $stmts[2]->stmts[2]->adaptations[0]->newName = null;
  92. $stmts[2]->stmts[3]->type = null;
  93. $stmts[3]->expr->dim = null;
  94. $stmts[4]->expr->expr = null;
  95. $stmts[5]->expr->if = null;
  96. $stmts[6]->expr->items[1]->key = null;
  97. $stmts[7]->expr->key = null;
  98. $stmts[8]->expr->value = null;
  99. $stmts[9]->num = null;
  100. $stmts[10]->num = null;
  101. $stmts[11]->keyVar = null;
  102. $stmts[12]->else = null;
  103. $stmts[13]->expr = null;
  104. $stmts[14]->vars[0]->default = null;
  105. $stmts[15]->finally = null;
  106. -----
  107. <?php
  108. function
  109. foo (
  110. Bar $foo,
  111. $bar)
  112. {}
  113. function
  114. ()
  115. {};
  116. class
  117. Foo
  118. {
  119. public
  120. function
  121. foo() {}
  122. public
  123. $prop
  124. ;
  125. use T {
  126. T
  127. ::
  128. x
  129. as
  130. public
  131. ;
  132. }
  133. const
  134. X
  135. = 1;
  136. }
  137. $foo [];
  138. exit ();
  139. $foo
  140. ?:
  141. $baz;
  142. [ $a => $b
  143. , $d];
  144. yield
  145. $bar;
  146. yield;
  147. break;
  148. continue;
  149. foreach(
  150. $array
  151. as
  152. $value
  153. ) {}
  154. if
  155. ($x)
  156. {
  157. }
  158. return;
  159. static
  160. $x
  161. ;
  162. try {} catch
  163. (X $y)
  164. {}
  165. -----
  166. <?php
  167. namespace
  168. A
  169. {
  170. }
  171. -----
  172. $stmts[0]->name = null;
  173. -----
  174. <?php
  175. namespace
  176. {
  177. }
  178. -----
  179. <?php
  180. try
  181. {
  182. }
  183. catch (Exception $e)
  184. {
  185. }
  186. -----
  187. $stmts[0]->catches[0]->var = null;
  188. -----
  189. <?php
  190. try
  191. {
  192. }
  193. catch (Exception)
  194. {
  195. }