Skip to content

[Configuration] Deprecate and disable withSetProviders() - #8392

Merged
TomasVotruba merged 3 commits into
mainfrom
deprecate-with-set-providers
Aug 28, 2026
Merged

[Configuration] Deprecate and disable withSetProviders()#8392
TomasVotruba merged 3 commits into
mainfrom
deprecate-with-set-providers

Conversation

@TomasVotruba

@TomasVotruba TomasVotruba commented Aug 28, 2026

Copy link
Copy Markdown
Member

Set providers are now loaded internally, so withSetProviders() is no longer applied. Calling it emits an E_USER_DEPRECATED warning and points to withComposerBased().

Changes

  • withSetProviders() is a no-op that warns and returns $this
  • Removed the now-dead setGroups / groupLoadedSets plumbing from RectorConfigBuilder
  • withComposerBased() only loads defined set-list constants; the deprecated set-group fallback is gone
  • Removed the unused SetManager (its group matching always resolved to nothing without providers)
 return RectorConfig::configure()
-    ->withSetProviders(SomeSetProvider::class)
+    ->withComposerBased(symfony: true, doctrine: true)
 ;

SetProviderCollector stays as it is @api for third-party bridges.

https://claude.ai/code/session_015hE4UdetizXAUwE7JKZHX7

Set providers are now loaded internally, so withSetProviders() is no
longer applied - it emits E_USER_DEPRECATED and points to
withComposerBased(). Drop the setGroups/groupLoadedSets plumbing and the
composer-based set-group fallback; withComposerBased() now only loads
defined set-list constants.

Claude-Session: https://claude.ai/code/session_015hE4UdetizXAUwE7JKZHX7
With set providers gone, group matching always yielded nothing, so
SetManager and its SetProviderCollector wiring are unused. Remove the
class and update the extension composer-based test accordingly.

Claude-Session: https://claude.ai/code/session_015hE4UdetizXAUwE7JKZHX7
@TomasVotruba
TomasVotruba force-pushed the deprecate-with-set-providers branch from bcc7015 to e0c8f1d Compare August 28, 2026 21:53
@TomasVotruba TomasVotruba changed the title [Configuration] Deprecate withSetProviders(), suggest withComposerBased() [Configuration] Deprecate and disable withSetProviders() Aug 28, 2026
@TomasVotruba
TomasVotruba force-pushed the deprecate-with-set-providers branch from 7203f3a to d864d57 Compare August 28, 2026 21:58
@TomasVotruba
TomasVotruba merged commit c981460 into main Aug 28, 2026
44 checks passed
@TomasVotruba
TomasVotruba deleted the deprecate-with-set-providers branch August 28, 2026 22:00
@ghostwriter

Copy link
Copy Markdown
Contributor

Why are features being removed in patch releases?

Please review AI-generated changes for backward-compatible breaks before merging them.

This change disabled every Rector extension that uses set providers.

Eg. https://redirect.github.com/Sylius/SyliusRector/pull/64

@TomasVotruba

Copy link
Copy Markdown
Member Author

Because it no longer worked, as set providers are long gone. Poor design overriding future changes.
Make sure to subscribe to releases in https://github.com/rectorphp/rector, not to miss these changes before deprecations.

See https://getrector.com/documentation/composer-based-sets#content-make-a-rule-bound-to-a-package-version

This is how the sets were migrated in Laravel Rector:

@ghostwriter

Copy link
Copy Markdown
Contributor

Deprecations warn developers that an API may be removed or changed in a future major release.

Incompatible API changes should not be introduced in minor or patch releases.

https://semver.org

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