Skip to content

[set] remove unused version-based-set constants and configs - #1019

Merged
TomasVotruba merged 5 commits into
mainfrom
tv-sets-config-cleanup
Aug 7, 2026
Merged

[set] remove unused version-based-set constants and configs#1019
TomasVotruba merged 5 commits into
mainfrom
tv-sets-config-cleanup

Conversation

@TomasVotruba

@TomasVotruba TomasVotruba commented Aug 7, 2026

Copy link
Copy Markdown
Member

Use ->withComposerBased(symfony: true) instead: https://getrector.com/documentation/composer-based-sets

Ref rectorphp/rector-src#7877

Before

Every Symfony version set had to be listed by hand, and each one had to be kept in sync with the very same configuration in composer-based.php:

return RectorConfig::configure()
    ->withSets([
        SymfonySetList::SYMFONY_25,
        SymfonySetList::SYMFONY_26,
        SymfonySetList::SYMFONY_27,
        SymfonySetList::SYMFONY_28,
        SymfonySetList::SYMFONY_30,
        SymfonySetList::SYMFONY_31,
        SymfonySetList::SYMFONY_32,
        SymfonySetList::SYMFONY_33,
        SymfonySetList::SYMFONY_34,
        SymfonySetList::SYMFONY_40,
        // ...and 23 more, up to SYMFONY_81
    ]);

After

The installed Symfony package versions pick the rules:

return RectorConfig::configure()
    ->withComposerBased(symfony: true);

What changed

  • 195 per-version set files removed, their configuration is already in config/sets/symfony/composer-based.php, bound to the exact package version it was introduced in
  • the matching SymfonySetList::SYMFONY_* constants removed
  • tests/Set/Symfony* suites removed - the rules and the composer-based set are the source of truth and have their own tests

@TomasVotruba TomasVotruba changed the title [set] remove unused versin-based-set constants and configs [set] remove unused version-based-set constants and configs Aug 7, 2026
The version sets no longer carry their own configuration, the rules and
their composer-bound configuration in "composer-based.php" are the source
of truth and are covered by their own tests.
…ES constant

The set constants are gone, so the "annotations-to-attributes" set imports
the validator attributes set by path, and the ignored deprecation pattern
no longer matches anything.
The "setDefaultOptions" rename is bound to symfony/form 2.7 and the
"OptionsResolverInterface" rename to symfony/options-resolver 2.7,
so the symfony27 set has nothing left to register.
@TomasVotruba
TomasVotruba enabled auto-merge (squash) August 7, 2026 10:02
@TomasVotruba
TomasVotruba merged commit bfa9a5e into main Aug 7, 2026
7 checks passed
@TomasVotruba
TomasVotruba deleted the tv-sets-config-cleanup branch August 7, 2026 10:03
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