removalViaNull.test 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  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. }
  35. $foo [ $bar ];
  36. exit ( $bar );
  37. $foo
  38. ? $bar :
  39. $baz;
  40. [ $a => $b
  41. , $c => $d];
  42. yield
  43. $foo
  44. =>
  45. $bar;
  46. yield
  47. $bar;
  48. break
  49. 2
  50. ;
  51. continue
  52. 2
  53. ;
  54. foreach(
  55. $array
  56. as
  57. $key
  58. =>
  59. $value
  60. ) {}
  61. if
  62. ($x)
  63. {
  64. }
  65. else {}
  66. return
  67. $val
  68. ;
  69. static
  70. $x
  71. =
  72. $y
  73. ;
  74. try {} catch
  75. (X $y)
  76. {}
  77. finally
  78. {}
  79. -----
  80. $stmts[0]->returnType = null;
  81. $stmts[0]->params[0]->default = null;
  82. $stmts[0]->params[1]->type = null;
  83. $stmts[1]->expr->returnType = null;
  84. $stmts[2]->extends = null;
  85. $stmts[2]->stmts[0]->returnType = null;
  86. $stmts[2]->stmts[1]->props[0]->default = null;
  87. $stmts[2]->stmts[2]->adaptations[0]->newName = null;
  88. $stmts[3]->expr->dim = null;
  89. $stmts[4]->expr->expr = null;
  90. $stmts[5]->expr->if = null;
  91. $stmts[6]->expr->items[1]->key = null;
  92. $stmts[7]->expr->key = null;
  93. $stmts[8]->expr->value = null;
  94. $stmts[9]->num = null;
  95. $stmts[10]->num = null;
  96. $stmts[11]->keyVar = null;
  97. $stmts[12]->else = null;
  98. $stmts[13]->expr = null;
  99. $stmts[14]->vars[0]->default = null;
  100. $stmts[15]->finally = null;
  101. -----
  102. <?php
  103. function
  104. foo (
  105. Bar $foo,
  106. $bar)
  107. {}
  108. function
  109. ()
  110. {};
  111. class
  112. Foo
  113. {
  114. public
  115. function
  116. foo() {}
  117. public
  118. $prop
  119. ;
  120. use T {
  121. T
  122. ::
  123. x
  124. as
  125. public
  126. ;
  127. }
  128. }
  129. $foo [];
  130. exit ();
  131. $foo
  132. ?:
  133. $baz;
  134. [ $a => $b
  135. , $d];
  136. yield
  137. $bar;
  138. yield;
  139. break;
  140. continue;
  141. foreach(
  142. $array
  143. as
  144. $value
  145. ) {}
  146. if
  147. ($x)
  148. {
  149. }
  150. return;
  151. static
  152. $x
  153. ;
  154. try {} catch
  155. (X $y)
  156. {}
  157. -----
  158. <?php
  159. namespace
  160. A
  161. {
  162. }
  163. -----
  164. $stmts[0]->name = null;
  165. -----
  166. <?php
  167. namespace
  168. {
  169. }