File tree Expand file tree Collapse file tree
rules/CodeQuality/Rector/BooleanOr Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -65,9 +65,6 @@ public function getNodeTypes(): array
6565 */
6666 public function refactor (Node $ node ): ?FuncCall
6767 {
68- $ identicals = $ this ->betterNodeFinder ->findInstanceOf ($ node , Identical::class);
69- $ equals = $ this ->betterNodeFinder ->findInstanceOf ($ node , Equal::class);
70-
7168 if (! $ this ->isEqualOrIdentical ($ node ->right )) {
7269 return null ;
7370 }
@@ -106,6 +103,9 @@ public function refactor(Node $node): ?FuncCall
106103
107104 $ args = $ this ->nodeFactory ->createArgs ([$ firstComparedExprAndValue ->getComparedExpr (), $ array ]);
108105
106+ $ identicals = $ this ->betterNodeFinder ->findInstanceOf ($ node , Identical::class);
107+ $ equals = $ this ->betterNodeFinder ->findInstanceOf ($ node , Equal::class);
108+
109109 if ($ identicals !== [] && $ equals === []) {
110110 $ args [] = new Arg (new ConstFetch (new Name ('true ' )));
111111 }
You can’t perform that action at this time.
0 commit comments