[Sets] Remove DoctrineSetProvider, its sets are covered by the composer-based rules - #501
Merged
Merged
Conversation
rectorphp/rector-src#8296 deprecates the set objects in favor of bonding rules with the ComposerPackageConstraintInterface. Doctrine is still resolved through composer-triggered sets, 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.
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.
Follows rectorphp/rector-src#8296, which deprecates the set objects in favor of bonding rules with
ComposerPackageConstraintInterface, and mirrors what rector-symfony and rector-phpunit already did — the provider goes away instead of being ignored inphpstan.neon.Every set the provider handed out is already covered by
config/sets/composer-based.php, with the same package and the same lowest version the triggered set used:ComposerTriggeredSetcomposer-based.phpbydoctrine/common2.0RenameClassRector,>=2.0doctrine/collection2.2CriteriaOrderingConstantsDeprecationRector,doctrine/collections >=2.2doctrine/doctrine-bundle2.3 / 2.8AddAnnotationToRepositoryRector>=2.3,EventSubscriberInterfaceToAttributeRector>=2.8doctrine/dbal2.11 / 3.0 / 3.8 / 4.0 / 4.2>=2.11,>=3.0,>=4.0, plusMigrateQueryBuilderResetQueryPartRector>=3.8,AddArrayResultColumnNamesRector>=4.2doctrine/orm2.5 / 2.13 / 2.14 / 3.0AddParamTypeDeclarationRector+ArgumentRemoverRector>=2.5, renames>=2.13,ReplaceLifecycleEventArgsByDedicatedEventArgsRector>=2.14,SetParametersArrayToCollectionRector+CastDoctrineExprToStringRector>=3.0doctrine/data-fixtures1.6 / 1.7AddGetReferenceTypeRector>=1.6,AddReturnTypeDeclarationRector>=1.7doctrine/mongodb-odm2.16RenameAttributeRector,>=2.16SetsAnnotationToAttributeRector/NestedAnnotationToAttributeRectorbound todoctrine/orm >=2.9,doctrine/mongodb-odm >=2.3,doctrine/mongodb-odm-bundle >=4.4,gedmo/doctrine-extensions >=3.5The version-specific set files stay on disk —
DoctrineSetListstill points at them as deprecated constants, so anyone listing them by hand keeps working.What a bonded rule buys over a triggered set
A triggered set only fired on the major version it was registered for, so a project jumping straight from ORM 2.5 to 3.0 had to walk every set in between. The bonded rule states the version its target API arrived in and applies from there upwards:
Needs the matching rector-src change
SetProviderCollectorstill doesnew DoctrineSetProvider(), andwithComposerBased(doctrine: true)still resolves Doctrine throughSetGroup::DOCTRINE. Both have to move in the same release — the collector entry dropped, and the commented-out line filled in: