Skip to content

[Sets] Ignore the deprecated set objects in TwigSetProvider - #1014

Closed
TomasVotruba wants to merge 1 commit into
mainfrom
ignore-deprecated-set-objects
Closed

[Sets] Ignore the deprecated set objects in TwigSetProvider#1014
TomasVotruba wants to merge 1 commit into
mainfrom
ignore-deprecated-set-objects

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Prepares for rectorphp/rector-src#8296, which deprecates the set objects in favor of bonding rules with ComposerPackageConstraintInterface.

Twig is still resolved through a composer-triggered set, so TwigSetProvider keeps implementing SetProviderInterface and instantiating ComposerTriggeredSet until its rules carry their own twig/twig constraint. Without this, the downstream PHPStan job of rector-src fails the moment the deprecation lands:

Class Rector\Symfony\Set\SetProvider\TwigSetProvider implements deprecated interface Rector\Set\Contract\SetProviderInterface
Instantiation of deprecated class Rector\Set\ValueObject\ComposerTriggeredSet
-
    message: '#deprecated (class|interface) Rector\\Set\\#'
    path: src/Set/SetProvider/TwigSetProvider.php
    # the deprecation is not released yet, so the errors are not reported here yet either
    reportUnmatched: false

reportUnmatched: false is what makes this mergeable in either order — the entry holds both now, where the installed rector-src has no deprecation and the pattern matches nothing, and after #8296 is released.

rectorphp/rector-src#8296 deprecates the set objects in favor of bonding rules with the ComposerPackageConstraintInterface. Twig is still resolved through a composer-triggered set, so the provider keeps using them until its rules are bonded.

The entry is not reported when unmatched, so it holds both before and after the deprecation is released.
@TomasVotruba
TomasVotruba deleted the ignore-deprecated-set-objects branch August 5, 2026 12:16
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