File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
rules/DowngradePhp80/Rector/FuncCall Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 1919use PhpParser \Node \Expr \MethodCall ;
2020use PhpParser \Node \Expr \StaticCall ;
2121use PhpParser \Node \Expr \Ternary ;
22+ use PhpParser \Node \Stmt \Do_ ;
2223use PhpParser \Node \Stmt \If_ ;
24+ use PhpParser \Node \Stmt \While_ ;
2325use PHPStan \Reflection \FunctionReflection ;
2426use PHPStan \Reflection \MethodReflection ;
2527use PHPStan \Type \Constant \ConstantIntegerType ;
@@ -73,12 +75,14 @@ public function getNodeTypes(): array
7375 StaticCall::class,
7476 AssignOp::class,
7577 If_::class,
78+ While_::class,
79+ Do_::class,
7680 FuncCall::class,
7781 ];
7882 }
7983
8084 /**
81- * @param Cast|Empty_|BooleanNot|Ternary|Identical|Concat|MethodCall|StaticCall|AssignOp|If_|FuncCall $node
85+ * @param Cast|Empty_|BooleanNot|Ternary|Identical|Concat|MethodCall|StaticCall|AssignOp|If_|While_|Do_| FuncCall $node
8286 */
8387 public function refactor (Node $ node ): ?Node
8488 {
@@ -113,7 +117,7 @@ public function refactor(Node $node): ?Node
113117 return null ;
114118 }
115119
116- if ($ node instanceof If_) {
120+ if ($ node instanceof If_ || $ node instanceof While_ || $ node instanceof Do_ ) {
117121 $ node ->cond ->setAttribute (self ::IS_UNCASTABLE , true );
118122 return null ;
119123 }
You can’t perform that action at this time.
0 commit comments