[Sets] Deprecate ComposerTriggeredSet in favor of ComposerPackageConstraintInterface - #8296
Open
TomasVotruba wants to merge 2 commits into
Open
[Sets] Deprecate ComposerTriggeredSet in favor of ComposerPackageConstraintInterface#8296TomasVotruba wants to merge 2 commits into
TomasVotruba wants to merge 2 commits into
Conversation
…traintInterface A set triggered on a single major version has to be repeated for every version an upgrade passes through. A rule bonded with ComposerPackageConstraintInterface, added in #7877, states the exact package version its target API is available from and applies from there upwards, so one set covers every upgrade path. rectorphp/rector-symfony#1010 and rectorphp/rector-phpunit#758 moved both extensions over, leaving Twig as the only remaining user. The internal resolving of the class is kept working and ignored in phpstan.neon until that lands too.
TomasVotruba
force-pushed
the
deprecate-composer-triggered-set
branch
from
August 5, 2026 11:56
8213aca to
1b70019
Compare
SetInterface, Set, SetProviderInterface, SetManager, SetProviderCollector and the two core providers exist to describe a set as an object, so it can be matched against the installed packages. A rule bonded with ComposerPackageConstraintInterface needs none of that: it states the package version its target API is available from, and a plain set file registers it. Every note links to this PR, so the reasoning is one click away. Internal resolving keeps working and is ignored in phpstan.neon, as the sets are still served from here.
This was referenced Aug 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ComposerPackageConstraintInterfacefrom #7877 turned out to replaceComposerTriggeredSetoutright, not just complement it, so the class is now marked deprecated.The comparison table in #7877 framed the triggered set as the tool for upgrade paths — one set per version jump. In practice that is the weakness: a project going from PHPUnit 6 to 12 had to pick up six sets in order, and every rule had to be repeated in each of them to survive a direct jump. A bonded rule needs none of that:
It is also more precise than
^matching allows —>=12.0.3,>=13.2, or>=8.4 <10.0for an API that was later removed.Both extensions have moved:
Twig is the last user, through
TwigSetProvider. So the class keeps working, and the internal resolving inSetManagerandSetProviderCollectoris ignored inphpstan.neonrather than rewritten, until that one moves over too.The rest of the set object machinery goes with it
A set described as an object only ever existed so it could be matched against the installed packages. Once the rules carry that information themselves, a plain set file is enough, so these are deprecated too:
SetInterfaceandSetSetProviderInterface,SetManager,SetProviderCollectorCoreSetProviderandPHPSetProviderEvery note links back to this PR, so anyone hitting the deprecation in an IDE can read the reasoning here.
Nothing is removed and nothing changes at runtime — the sets are still served from these classes, so their internal use is ignored in
phpstan.neonrather than rewritten.Green: 5373 tests, PHPStan and ECS clean.