Skip to content

Commit fed1892

Browse files
committed
fix
1 parent dc7b56e commit fed1892

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

rules/DowngradePhp73/Rector/ConstFetch/DowngradePhp73JsonConstRector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Rector\DowngradePhp73\Rector\ConstFetch;
66

7+
use PhpParser\NodeVisitor;
78
use PhpParser\Node;
89
use PhpParser\Node\Arg;
910
use PhpParser\Node\Expr;
@@ -23,7 +24,6 @@
2324
use PhpParser\Node\Stmt\Throw_;
2425
use PhpParser\Node\Stmt\TryCatch;
2526
use PhpParser\Node\VariadicPlaceholder;
26-
use PhpParser\NodeTraverser;
2727
use Rector\DowngradePhp72\NodeManipulator\JsonConstCleaner;
2828
use Rector\Enum\JsonConstant;
2929
use Rector\NodeAnalyzer\DefineFuncCallAnalyzer;
@@ -120,7 +120,7 @@ public function refactor(Node $node): int|null|Expr|If_|array
120120
$node->stmts,
121121
function (Node $subNode): ?int {
122122
if ($subNode instanceof Class_ || $subNode instanceof Function_ || $subNode instanceof Closure) {
123-
return NodeTraverser::DONT_TRAVERSE_CURRENT_AND_CHILDREN;
123+
return NodeVisitor::DONT_TRAVERSE_CURRENT_AND_CHILDREN;
124124
}
125125

126126
if (! $subNode instanceof Expression) {

rules/DowngradePhp74/Rector/ArrowFunction/ArrowFunctionToAnonymousFunctionRector.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Rector\DowngradePhp74\Rector\ArrowFunction;
66

7+
use PhpParser\Node\Expr\Throw_;
78
use PhpParser\Node;
89
use PhpParser\Node\ClosureUse;
910
use PhpParser\Node\Expr;

rules/DowngradePhp80/Rector/Expression/DowngradeMatchToSwitchRector.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Rector\DowngradePhp80\Rector\Expression;
66

7+
use PhpParser\NodeVisitor;
78
use PhpParser\Node;
89
use PhpParser\Node\Arg;
910
use PhpParser\Node\ArrayItem;
@@ -25,7 +26,6 @@
2526
use PhpParser\Node\Stmt\Expression;
2627
use PhpParser\Node\Stmt\Return_;
2728
use PhpParser\Node\Stmt\Switch_;
28-
use PhpParser\NodeTraverser;
2929
use PHPStan\Analyser\Scope;
3030
use Rector\NodeTypeResolver\Node\AttributeKey;
3131
use Rector\Php72\NodeFactory\AnonymousFunctionFactory;
@@ -120,7 +120,7 @@ function (Node $subNode) use ($node, &$match, &$hasChanged, $scope) {
120120
$subNode->value = new FuncCall($this->anonymousFunctionFactory->create([], [$switch], null));
121121

122122
$hasChanged = true;
123-
return NodeTraverser::DONT_TRAVERSE_CURRENT_AND_CHILDREN;
123+
return NodeVisitor::DONT_TRAVERSE_CURRENT_AND_CHILDREN;
124124
}
125125

126126
if ($subNode instanceof Arg && $subNode->value instanceof ArrowFunction && $subNode->value->expr instanceof Match_) {
@@ -129,7 +129,7 @@ function (Node $subNode) use ($node, &$match, &$hasChanged, $scope) {
129129
$hasChanged = true;
130130
}
131131

132-
return NodeTraverser::DONT_TRAVERSE_CURRENT_AND_CHILDREN;
132+
return NodeVisitor::DONT_TRAVERSE_CURRENT_AND_CHILDREN;
133133
}
134134

135135
if ($subNode instanceof Assign && $subNode->expr instanceof ArrowFunction && $subNode->expr->expr instanceof Match_) {
@@ -138,7 +138,7 @@ function (Node $subNode) use ($node, &$match, &$hasChanged, $scope) {
138138
$hasChanged = true;
139139
}
140140

141-
return NodeTraverser::DONT_TRAVERSE_CURRENT_AND_CHILDREN;
141+
return NodeVisitor::DONT_TRAVERSE_CURRENT_AND_CHILDREN;
142142
}
143143

144144
if ($subNode instanceof Expression && $subNode->expr instanceof ArrowFunction && $subNode->expr->expr instanceof Match_) {
@@ -147,7 +147,7 @@ function (Node $subNode) use ($node, &$match, &$hasChanged, $scope) {
147147
$hasChanged = true;
148148
}
149149

150-
return NodeTraverser::DONT_TRAVERSE_CURRENT_AND_CHILDREN;
150+
return NodeVisitor::DONT_TRAVERSE_CURRENT_AND_CHILDREN;
151151
}
152152

153153
if ($subNode instanceof Return_ && $subNode->expr instanceof ArrowFunction && $subNode->expr->expr instanceof Match_) {
@@ -156,7 +156,7 @@ function (Node $subNode) use ($node, &$match, &$hasChanged, $scope) {
156156
$hasChanged = true;
157157
}
158158

159-
return NodeTraverser::DONT_TRAVERSE_CURRENT_AND_CHILDREN;
159+
return NodeVisitor::DONT_TRAVERSE_CURRENT_AND_CHILDREN;
160160
}
161161

162162
if ($subNode instanceof FuncCall && $subNode->name instanceof ArrowFunction && $subNode->name->expr instanceof Match_) {
@@ -165,12 +165,12 @@ function (Node $subNode) use ($node, &$match, &$hasChanged, $scope) {
165165
$hasChanged = true;
166166
}
167167

168-
return NodeTraverser::DONT_TRAVERSE_CURRENT_AND_CHILDREN;
168+
return NodeVisitor::DONT_TRAVERSE_CURRENT_AND_CHILDREN;
169169
}
170170

171171
if ($subNode instanceof Match_) {
172172
$match = $subNode;
173-
return NodeTraverser::STOP_TRAVERSAL;
173+
return NodeVisitor::STOP_TRAVERSAL;
174174
}
175175
}
176176
);

0 commit comments

Comments
 (0)