mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-19 15:45:43 +01:00
make use of matchFirstAndSecondConditionNode Node type
This commit is contained in:
parent
3ecf8172ed
commit
09e949f76e
@ -94,9 +94,7 @@ CODE_SAMPLE
|
||||
|
||||
$matchedNodes = $this->binaryOpMaintainer->matchFirstAndSecondConditionNode(
|
||||
$ifCondition,
|
||||
function (Node $node) {
|
||||
return $node instanceof Variable;
|
||||
},
|
||||
Variable::class,
|
||||
function (Node $node, Node $otherNode) use ($foreachValueNode) {
|
||||
return $this->areNodesEqual($otherNode, $foreachValueNode);
|
||||
}
|
||||
|
@ -80,9 +80,7 @@ final class SimplifyConditionsRector extends AbstractRector
|
||||
function (Node $node) {
|
||||
return $node instanceof Identical || $node instanceof NotIdentical;
|
||||
},
|
||||
function (Node $node) {
|
||||
return $node;
|
||||
}
|
||||
Node::class
|
||||
);
|
||||
|
||||
if ($matchedNodes === null) {
|
||||
|
@ -22,4 +22,4 @@ class SomeClass
|
||||
}
|
||||
|
||||
$objects = [];
|
||||
echo is_array($objects) && is_array($objects);
|
||||
is_array($objects) && is_array($objects);
|
||||
|
@ -22,4 +22,4 @@ class SomeClass
|
||||
}
|
||||
|
||||
$objects = [];
|
||||
echo is_array($objects) && is_array($objects);
|
||||
is_array($objects) && is_array($objects);
|
||||
|
@ -2,7 +2,6 @@
|
||||
|
||||
namespace Rector\Php;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Arg;
|
||||
use PhpParser\Node\Expr\BinaryOp\BooleanOr;
|
||||
use PhpParser\Node\Expr\FuncCall;
|
||||
@ -34,12 +33,8 @@ final class DualCheckToAble
|
||||
{
|
||||
$matchedNodes = $this->binaryOpMaintainer->matchFirstAndSecondConditionNode(
|
||||
$booleanOrNode,
|
||||
function (Node $node) {
|
||||
return $node instanceof Instanceof_;
|
||||
},
|
||||
function (Node $node) {
|
||||
return $node instanceof FuncCall;
|
||||
}
|
||||
Instanceof_::class,
|
||||
FuncCall::class
|
||||
);
|
||||
|
||||
if ($matchedNodes === null) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user