Skip to content

[trav] Move rule selection to RectorRegistry - #8619

Merged
TomasVotruba merged 7 commits into
mainfrom
tv-rector-runner-10
Oct 11, 2026
Merged

TomasVotruba merged 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
@TomasVotruba
TomasVotruba merged commit 359eb18 into main Oct 11, 2026
49 checks passed
@TomasVotruba
TomasVotruba deleted the tv-rector-runner-10 branch October 11, 2026 16:56
@TomasVotruba

Copy link
Copy Markdown
Member Author

Lets ship this 👍

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