Skip to content

[trav] Move rule selection to RectorRegistry - #8619

Open
TomasVotruba wants to merge 7 commits into
mainfrom
tv-rector-runner-10
Open

TomasVotruba wants to merge 7 commits into
mainfrom
tv-rector-runner-10

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Moves per-node rule selection and filtering out of RectorNodeTraverser into RectorRegistry.

Changes

  • RectorNodeTraverser now delegates to RectorRegistry::forNode() instead of its own getVisitorsForNode()/refreshPhpRectors(); PHP-version, composer-constraint and configuration filtering live in RectorRegistry::filterRectors().
  • RectorRegistry::refreshRectors() now also clears the forNode cache, so a refreshed rule set is not shadowed by stale per-node cache entries (surfaced by the shared container across test classes).
  • Dropped the dead refreshPhpRectors() call from AbstractRectorTestCase; the registry sync right below it already keeps rules in step.
  • Tests migrated to the new API: StopTraverseOnTypeChangeTest and a rewritten RectorRegistryTest drive RectorRegistry; the orphaned RectorNodeTraverserTest (only tested the removed getVisitorsForNode) is folded into RectorRegistryTest.

@TomasVotruba TomasVotruba changed the title Move rule selection to RectorRegistry [trav] Move rule selection to RectorRegistry Oct 11, 2026
@TomasVotruba
TomasVotruba marked this pull request as ready for review October 11, 2026 11:15
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.

2 participants