File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
rules/DeadCode/Rector/Assign Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 88use PhpParser \Node \Expr ;
99use PhpParser \Node \Expr \Assign ;
1010use PhpParser \Node \Expr \AssignRef ;
11- use PhpParser \Node \Expr \CallLike ;
1211use PhpParser \Node \Expr \Cast ;
1312use PhpParser \Node \Expr \Closure ;
1413use PhpParser \Node \Expr \FuncCall ;
1514use PhpParser \Node \Expr \Include_ ;
15+ use PhpParser \Node \Expr \MethodCall ;
16+ use PhpParser \Node \Expr \New_ ;
17+ use PhpParser \Node \Expr \NullsafeMethodCall ;
18+ use PhpParser \Node \Expr \StaticCall ;
1619use PhpParser \Node \Expr \Variable ;
1720use PhpParser \Node \Stmt ;
1821use PhpParser \Node \Stmt \Class_ ;
@@ -270,7 +273,11 @@ function (Node $subNode) use (&$refVariableNames) {
270273 continue ;
271274 }
272275
273- if ($ assign ->expr instanceof CallLike) {
276+ if ($ assign ->expr instanceof FuncCall
277+ || $ assign ->expr instanceof StaticCall
278+ || $ assign ->expr instanceof MethodCall
279+ || $ assign ->expr instanceof New_
280+ || $ assign ->expr instanceof NullsafeMethodCall) {
274281 $ targetCall = $ this ->astResolver ->resolveClassMethodOrFunctionFromCall ($ assign ->expr );
275282 if (($ targetCall instanceof ClassMethod || $ targetCall instanceof Function_)
276283 && $ this ->phpAttributeAnalyzer ->hasPhpAttribute ($ targetCall , 'NoDiscard ' )) {
You can’t perform that action at this time.
0 commit comments