Skip to content

Restore shouldSkipCurrentNode guard in RectorRunner - #8591

Merged
TomasVotruba merged 1 commit into
mainfrom
restore-skip-current-node-guard
Oct 10, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
restore-skip-current-node-guard

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

An experimental commit removing the shouldSkipCurrentNode guard slipped into the squash-merged #8586. Without it, a rule firing on a freshly reprinted node hits ScopeFetcher::fetch() on a scopeless node and throws 'Scope not available'.

This breaks behavioral tests both in rector-src (ChangeSwitchTernaryTest) and downstream packages (e.g. rector-doctrine RemoveNullFromNullableCollectionTypeRector), which surfaced as failing packages_tests on main.

Restores the 5-line guard that bails out before refactor() when a node was already rectified by the same rule or reprinted without a refreshed scope.

@TomasVotruba
TomasVotruba merged commit 599c558 into main Oct 10, 2026
49 checks passed
@TomasVotruba
TomasVotruba deleted the restore-skip-current-node-guard branch October 10, 2026 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant