From 621435b82acd107912479237bdb944f2151a539d Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Tue, 27 May 2025 07:09:55 +0700 Subject: [PATCH] Fix pull deprecated pull constant from NodeTraverser --- src/Rector/Rector/MethodCall/RemoveMethodCallRector.php | 4 ++-- .../Namespace_/AppUsesStaticCallToUseStatementRector.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Rector/Rector/MethodCall/RemoveMethodCallRector.php b/src/Rector/Rector/MethodCall/RemoveMethodCallRector.php index 3cf371b2..10faf47b 100644 --- a/src/Rector/Rector/MethodCall/RemoveMethodCallRector.php +++ b/src/Rector/Rector/MethodCall/RemoveMethodCallRector.php @@ -6,7 +6,7 @@ use PhpParser\Node; use PhpParser\Node\Expr\MethodCall; use PhpParser\Node\Stmt\Expression; -use PhpParser\NodeTraverser; +use PhpParser\NodeVisitor; use Rector\Contract\Rector\ConfigurableRectorInterface; use Rector\Rector\AbstractRector; use Symplify\RuleDocGenerator\ValueObject\CodeSample\ConfiguredCodeSample; @@ -71,7 +71,7 @@ public function refactor(Node $node): ?int continue; } - return NodeTraverser::REMOVE_NODE; + return NodeVisitor::REMOVE_NODE; } return null; diff --git a/src/Rector/Rector/Namespace_/AppUsesStaticCallToUseStatementRector.php b/src/Rector/Rector/Namespace_/AppUsesStaticCallToUseStatementRector.php index 9aa38185..8a922fab 100644 --- a/src/Rector/Rector/Namespace_/AppUsesStaticCallToUseStatementRector.php +++ b/src/Rector/Rector/Namespace_/AppUsesStaticCallToUseStatementRector.php @@ -12,7 +12,7 @@ use PhpParser\Node\Stmt\Namespace_; use PhpParser\Node\Stmt\Use_; use PhpParser\Node\UseItem; -use PhpParser\NodeTraverser; +use PhpParser\NodeVisitor; use PHPStan\Type\ObjectType; use Rector\Contract\PhpParser\Node\StmtsAwareInterface; use Rector\NodeTypeResolver\Node\AttributeKey; @@ -111,7 +111,7 @@ private function removeCallLikeStmts(StmtsAwareInterface $node, array $stmts, ar function (Node $subNode) use ($node, $appUsesStaticCalls, &$currentStmt) { // only lookup each of current stmts, avoid too deep traversal if ($subNode instanceof StmtsAwareInterface) { - return NodeTraverser::DONT_TRAVERSE_CURRENT_AND_CHILDREN; + return NodeVisitor::DONT_TRAVERSE_CURRENT_AND_CHILDREN; } if ($subNode instanceof Stmt) {