From daf34966a93686719df945dcbbc8677834bc31e4 Mon Sep 17 00:00:00 2001 From: bjorn Date: Fri, 24 Jan 2025 10:33:52 +0100 Subject: [PATCH] fix: REMOVE_NODE constant has moved --- phpstan-baseline.neon | 8 -------- src/Drupal9/Rector/Deprecation/PassRector.php | 4 ++-- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 8cb19a04..266ed64c 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -147,11 +147,3 @@ parameters: message: "#^Call to an undefined method PHPStan\\\\Type\\\\Type\\:\\:getValue\\(\\)\\.$#" count: 1 path: src/Drupal9/Rector/Deprecation/ExtensionPathRector.php - - - - message: """ - #^Fetching deprecated class constant REMOVE_NODE of class PhpParser\\\\NodeTraverser\\: - Use NodeVisitor\\:\\:REMOVE_NODE instead\\.$# - """ - count: 1 - path: src/Drupal9/Rector/Deprecation/PassRector.php diff --git a/src/Drupal9/Rector/Deprecation/PassRector.php b/src/Drupal9/Rector/Deprecation/PassRector.php index 60b68900..94a3dd12 100644 --- a/src/Drupal9/Rector/Deprecation/PassRector.php +++ b/src/Drupal9/Rector/Deprecation/PassRector.php @@ -6,7 +6,7 @@ use DrupalRector\Utility\GetDeclaringSourceTrait; use PhpParser\Node; -use PhpParser\NodeTraverser; +use PhpParser\NodeVisitor; use Rector\Rector\AbstractRector; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; @@ -51,7 +51,7 @@ public function refactor(Node $node) } if ($this->getDeclaringSource($node->expr) === 'Drupal\KernelTests\AssertLegacyTrait') { - return NodeTraverser::REMOVE_NODE; + return NodeVisitor::REMOVE_NODE; } return $node;