Skip to content

[Sets] Remove deprecated PHPUnitSetProvider - #759

Merged
TomasVotruba merged 1 commit into
mainfrom
remove-set-provider
Aug 5, 2026
Merged

[Sets] Remove deprecated PHPUnitSetProvider#759
TomasVotruba merged 1 commit into
mainfrom
remove-set-provider

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

SetProviderInterface, Set and the whole set-object machinery are deprecated in rectorphp/rector-src#8296 — rules now carry their own version info via ComposerPackageConstraintInterface.

Here the provider was already dead weight. Since #757 and #758 it returned plain Set objects only, and SetManager::matchBySetGroups() matches ComposerTriggeredSet exclusively:

foreach ($this->setProviderCollector->provideComposerTriggeredSets() as $composerTriggeredSet) {

So ->withSetGroups(SetGroup::PHPUNIT) loaded nothing from it. It is also absent from core's SetProviderCollector list (PHP, Core, Doctrine, Twig).

-final class PHPUnitSetProvider implements SetProviderInterface
-{
-    public function provide(): array
-    {
-        return [
-            new Set(SetGroup::PHPUNIT, 'Composer Based', __DIR__ . '/../../../config/sets/composer-based.php'),
-            new Set(SetGroup::PHPUNIT, 'Code Quality', __DIR__ . '/../../../config/sets/phpunit-code-quality.php'),
-            new Set(SetGroup::ATTRIBUTES, 'PHPUnit Attributes', __DIR__ . '/../../../config/sets/annotations-to-attributes.php'),
-        ];
-    }
-}

Sets stay reachable as before:

$rectorConfig->withSets([PHPUnitSetList::COMPOSER_BASED]);

No other reference to the class existed in configs, docs or tests.

The SetProviderInterface/Set machinery is deprecated in rectorphp/rector-src#8296, and since #757 and #758 this provider returned plain Set objects only, which SetManager::matchBySetGroups() never matched. Sets remain available via PHPUnitSetList constants.
@TomasVotruba
TomasVotruba merged commit aa344f6 into main Aug 5, 2026
7 checks passed
@TomasVotruba
TomasVotruba deleted the remove-set-provider branch August 5, 2026 12:13
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