From 33c32c168ab27757d09eca1b87e0c99debb38812 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Sat, 10 Oct 2026 12:49:51 +0200 Subject: [PATCH] experiment: remove shouldSkipCurrentNode guard in RectorRunner Drops the hard skip that bails out before refactor() when a node was already rectified by the same rule or just reprinted without a refreshed scope. Breaks ChangeSwitchTernaryTest: a rule firing on a freshly reprinted Expression node hits ScopeFetcher::fetch() on a scopeless node and throws 'Scope not available'. The guard was the safety net for that case (and for consecutive CREATED_BY_RULE re-application loops). --- src/Rector/RectorRunner.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Rector/RectorRunner.php b/src/Rector/RectorRunner.php index e1f2cb4b872..546e33991bf 100644 --- a/src/Rector/RectorRunner.php +++ b/src/Rector/RectorRunner.php @@ -63,11 +63,6 @@ public function run(RectorInterface $rector, Node $node): int|Node|null|array $filePath = $file->getFilePath(); - // node already changed by this rule in a previous pass → hard skip - if ($this->skipper->shouldSkipCurrentNode($rector::class, $node)) { - return null; - } - // class/path skip is configured for this rule and file: run the rule on a deep clone to learn // whether it would actually have changed anything. Only a skip that prevents a real change // counts as used; the original node is left untouched, so the file stays skipped either way.