From c398e4050fdf50513ad04b9654d6ce1e10121a27 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Fri, 7 Aug 2026 11:14:31 +0200 Subject: [PATCH 1/4] [set] remove unused set constants --- ecs.php | 2 +- src/Set/DoctrineSetList.php | 65 ------------------------------------- 2 files changed, 1 insertion(+), 66 deletions(-) diff --git a/ecs.php b/ecs.php index d921ddb5..3b9be6d5 100644 --- a/ecs.php +++ b/ecs.php @@ -5,7 +5,7 @@ use Symplify\EasyCodingStandard\Config\ECSConfig; return ECSConfig::configure() - ->withPreparedSets(psr12: true, common: true, cleanCode: true, symplify: true) + ->withPreparedSets(psr12: true, common: true, cleanCode: true) ->withPaths([ __DIR__ . '/src', __DIR__ . '/rules', diff --git a/src/Set/DoctrineSetList.php b/src/Set/DoctrineSetList.php index d8e5c255..47782a04 100644 --- a/src/Set/DoctrineSetList.php +++ b/src/Set/DoctrineSetList.php @@ -24,71 +24,6 @@ final class DoctrineSetList )] public const string YAML_TO_ANNOTATIONS = __DIR__ . '/../../config/yaml-to-annotations.php'; - #[Deprecated( - message: 'Use withComposerBased() instead, see https://getrector.com/blog/introducing-composer-version-based-sets' - )] - public const string DOCTRINE_COMMON_20 = __DIR__ . '/../../config/sets/doctrine-common-20.php'; - - #[Deprecated( - message: 'Use withComposerBased() instead, see https://getrector.com/blog/introducing-composer-version-based-sets' - )] - public const string DOCTRINE_COLLECTION_22 = __DIR__ . '/../../config/sets/doctrine-collection-22.php'; - - #[Deprecated( - message: 'Use withComposerBased() instead, see https://getrector.com/blog/introducing-composer-version-based-sets' - )] - public const string DOCTRINE_DBAL_211 = __DIR__ . '/../../config/sets/doctrine-dbal-211.php'; - - #[Deprecated( - message: 'Use withComposerBased() instead, see https://getrector.com/blog/introducing-composer-version-based-sets' - )] - public const string DOCTRINE_DBAL_30 = __DIR__ . '/../../config/sets/doctrine-dbal-30.php'; - - #[Deprecated( - message: 'Use withComposerBased() instead, see https://getrector.com/blog/introducing-composer-version-based-sets' - )] - public const string DOCTRINE_DBAL_38 = __DIR__ . '/../../config/sets/doctrine-dbal-38.php'; - - #[Deprecated( - message: 'Use withComposerBased() instead, see https://getrector.com/blog/introducing-composer-version-based-sets' - )] - public const string DOCTRINE_DBAL_40 = __DIR__ . '/../../config/sets/doctrine-dbal-40.php'; - - #[Deprecated( - message: 'Use withComposerBased() instead, see https://getrector.com/blog/introducing-composer-version-based-sets' - )] - public const string DOCTRINE_ORM_25 = __DIR__ . '/../../config/sets/doctrine-orm-25.php'; - - #[Deprecated( - message: 'Use withComposerBased() instead, see https://getrector.com/blog/introducing-composer-version-based-sets' - )] - public const string DOCTRINE_ORM_28 = __DIR__ . '/../../config/sets/doctrine-orm-28.php'; - - #[Deprecated( - message: 'Use withComposerBased() instead, see https://getrector.com/blog/introducing-composer-version-based-sets' - )] - public const string DOCTRINE_ORM_213 = __DIR__ . '/../../config/sets/doctrine-orm-213.php'; - - #[Deprecated( - message: 'Use withComposerBased() instead, see https://getrector.com/blog/introducing-composer-version-based-sets' - )] - public const string DOCTRINE_ORM_214 = __DIR__ . '/../../config/sets/doctrine-orm-214.php'; - - #[Deprecated( - message: 'Use withComposerBased() instead, see https://getrector.com/blog/introducing-composer-version-based-sets' - )] - public const string DOCTRINE_ORM_219 = __DIR__ . '/../../config/sets/doctrine-orm-219.php'; - - #[Deprecated( - message: 'Use withComposerBased() instead, see https://getrector.com/blog/introducing-composer-version-based-sets' - )] - public const string DOCTRINE_ORM_300 = __DIR__ . '/../../config/sets/doctrine-orm-300.php'; - - #[Deprecated( - message: 'Use withComposerBased() instead, see https://getrector.com/blog/introducing-composer-version-based-sets' - )] - public const string DOCTRINE_BUNDLE_230 = __DIR__ . '/../../config/sets/doctrine-bundle-23.php'; - public const string ANNOTATIONS_TO_ATTRIBUTES = __DIR__ . '/../../config/sets/attributes/doctrine.php'; public const string GEDMO_ANNOTATIONS_TO_ATTRIBUTES = __DIR__ . '/../../config/sets/attributes/gedmo.php'; From 78dc1716925e4f865e27b406a25c4bde6a2b0d53 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Fri, 7 Aug 2026 11:14:57 +0200 Subject: [PATCH 2/4] remove deprecated YAML_TO_ANNOTATIONS set --- config/yaml-to-annotations.php | 10 ---------- src/Set/DoctrineSetList.php | 5 ----- 2 files changed, 15 deletions(-) delete mode 100644 config/yaml-to-annotations.php diff --git a/config/yaml-to-annotations.php b/config/yaml-to-annotations.php deleted file mode 100644 index c1036ee6..00000000 --- a/config/yaml-to-annotations.php +++ /dev/null @@ -1,10 +0,0 @@ - Date: Fri, 7 Aug 2026 11:16:57 +0200 Subject: [PATCH 3/4] remove unused set files --- config/sets/data-fixtures-16.php | 10 - config/sets/data-fixtures-17.php | 15 - config/sets/doctrine-bundle-23.php | 10 - config/sets/doctrine-bundle-28.php | 11 - config/sets/doctrine-collection-22.php | 10 - config/sets/doctrine-common-20.php | 35 -- config/sets/doctrine-dbal-211.php | 182 --------- config/sets/doctrine-dbal-30.php | 33 -- config/sets/doctrine-dbal-38.php | 10 - config/sets/doctrine-dbal-40.php | 77 ---- config/sets/doctrine-dbal-42.php | 13 - config/sets/doctrine-mongodb-odm-216.php | 192 ---------- config/sets/doctrine-orm-213.php | 33 -- config/sets/doctrine-orm-214.php | 10 - config/sets/doctrine-orm-219.php | 459 ----------------------- config/sets/doctrine-orm-25.php | 36 -- config/sets/doctrine-orm-28.php | 11 - config/sets/doctrine-orm-300.php | 16 - src/Set/DoctrineSetList.php | 2 - 19 files changed, 1165 deletions(-) delete mode 100644 config/sets/data-fixtures-16.php delete mode 100644 config/sets/data-fixtures-17.php delete mode 100644 config/sets/doctrine-bundle-23.php delete mode 100644 config/sets/doctrine-bundle-28.php delete mode 100644 config/sets/doctrine-collection-22.php delete mode 100644 config/sets/doctrine-common-20.php delete mode 100644 config/sets/doctrine-dbal-211.php delete mode 100644 config/sets/doctrine-dbal-30.php delete mode 100644 config/sets/doctrine-dbal-38.php delete mode 100644 config/sets/doctrine-dbal-40.php delete mode 100644 config/sets/doctrine-dbal-42.php delete mode 100644 config/sets/doctrine-mongodb-odm-216.php delete mode 100644 config/sets/doctrine-orm-213.php delete mode 100644 config/sets/doctrine-orm-214.php delete mode 100644 config/sets/doctrine-orm-219.php delete mode 100644 config/sets/doctrine-orm-25.php delete mode 100644 config/sets/doctrine-orm-28.php delete mode 100644 config/sets/doctrine-orm-300.php diff --git a/config/sets/data-fixtures-16.php b/config/sets/data-fixtures-16.php deleted file mode 100644 index fb0d6f82..00000000 --- a/config/sets/data-fixtures-16.php +++ /dev/null @@ -1,10 +0,0 @@ -rules([AddGetReferenceTypeRector::class]); -}; diff --git a/config/sets/data-fixtures-17.php b/config/sets/data-fixtures-17.php deleted file mode 100644 index e3f25231..00000000 --- a/config/sets/data-fixtures-17.php +++ /dev/null @@ -1,15 +0,0 @@ -ruleWithConfiguration(AddReturnTypeDeclarationRector::class, [ - new AddReturnTypeDeclaration('Doctrine\Common\DataFixtures\OrderedFixtureInterface', 'getOrder', new IntegerType()), - ]); -}; diff --git a/config/sets/doctrine-bundle-23.php b/config/sets/doctrine-bundle-23.php deleted file mode 100644 index 54b4d936..00000000 --- a/config/sets/doctrine-bundle-23.php +++ /dev/null @@ -1,10 +0,0 @@ -rule(AddAnnotationToRepositoryRector::class); -}; diff --git a/config/sets/doctrine-bundle-28.php b/config/sets/doctrine-bundle-28.php deleted file mode 100644 index 63a6bb31..00000000 --- a/config/sets/doctrine-bundle-28.php +++ /dev/null @@ -1,11 +0,0 @@ -rule(EventSubscriberInterfaceToAttributeRector::class); -}; diff --git a/config/sets/doctrine-collection-22.php b/config/sets/doctrine-collection-22.php deleted file mode 100644 index 360cc8e7..00000000 --- a/config/sets/doctrine-collection-22.php +++ /dev/null @@ -1,10 +0,0 @@ -rules([CriteriaOrderingConstantsDeprecationRector::class]); -}; diff --git a/config/sets/doctrine-common-20.php b/config/sets/doctrine-common-20.php deleted file mode 100644 index 7de68710..00000000 --- a/config/sets/doctrine-common-20.php +++ /dev/null @@ -1,35 +0,0 @@ -ruleWithConfiguration(RenameClassRector::class, [ - 'Doctrine\Common\Persistence\Event\LifecycleEventArgs' => 'Doctrine\Persistence\Event\LifecycleEventArgs', - 'Doctrine\Common\Persistence\Event\LoadClassMetadataEventArgs' => 'Doctrine\Persistence\Event\LoadClassMetadataEventArgs', - 'Doctrine\Common\Persistence\Event\ManagerEventArgs' => 'Doctrine\Persistence\Event\ManagerEventArgs', - 'Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory' => 'Doctrine\Persistence\Mapping\AbstractClassMetadataFactory', - 'Doctrine\Common\Persistence\Mapping\ClassMetadata' => 'Doctrine\Persistence\Mapping\ClassMetadata', - 'Doctrine\Common\Persistence\Mapping\ClassMetadataFactory' => 'Doctrine\Persistence\Mapping\ClassMetadataFactory', - 'Doctrine\Common\Persistence\Mapping\Driver\FileDriver' => 'Doctrine\Persistence\Mapping\Driver\FileDriver', - 'Doctrine\Common\Persistence\Mapping\Driver\MappingDriver' => 'Doctrine\Persistence\Mapping\Driver\MappingDriver', - 'Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain' => 'Doctrine\Persistence\Mapping\Driver\MappingDriverChain', - 'Doctrine\Common\Persistence\Mapping\Driver\PHPDriver' => 'Doctrine\Persistence\Mapping\Driver\PHPDriver', - 'Doctrine\Common\Persistence\Mapping\Driver\StaticPHPDriver' => 'Doctrine\Persistence\Mapping\Driver\StaticPHPDriver', - 'Doctrine\Common\Persistence\Mapping\Driver\SymfonyFileLocator' => 'Doctrine\Persistence\Mapping\Driver\SymfonyFileLocator', - 'Doctrine\Common\Persistence\Mapping\MappingException' => 'Doctrine\Persistence\Mapping\MappingException', - 'Doctrine\Common\Persistence\Mapping\ReflectionService' => 'Doctrine\Persistence\Mapping\ReflectionService', - 'Doctrine\Common\Persistence\Mapping\RuntimeReflectionService' => 'Doctrine\Persistence\Mapping\RuntimeReflectionService', - 'Doctrine\Common\Persistence\Mapping\StaticReflectionService' => 'Doctrine\Persistence\Mapping\StaticReflectionService', - 'Doctrine\Common\Persistence\ObjectManager' => 'Doctrine\Persistence\ObjectManager', - 'Doctrine\Common\Persistence\ObjectManagerDecorator' => 'Doctrine\Persistence\ObjectManagerDecorator', - 'Doctrine\Common\Persistence\ObjectRepository' => 'Doctrine\Persistence\ObjectRepository', - 'Doctrine\Common\Persistence\Proxy' => 'Doctrine\Persistence\Proxy', - 'Doctrine\Common\Persistence\AbstractManagerRegistry' => 'Doctrine\Persistence\AbstractManagerRegistry', - 'Doctrine\Common\Persistence\Mapping\Driver\DefaultFileLocator' => 'Doctrine\Persistence\Mapping\Driver\DefaultFileLocator', - 'Doctrine\Common\Persistence\ManagerRegistry' => 'Doctrine\Persistence\ManagerRegistry', - ]); -}; diff --git a/config/sets/doctrine-dbal-211.php b/config/sets/doctrine-dbal-211.php deleted file mode 100644 index 54b8b5b2..00000000 --- a/config/sets/doctrine-dbal-211.php +++ /dev/null @@ -1,182 +0,0 @@ -ruleWithConfiguration(RenameClassConstFetchRector::class, [ - new RenameClassAndConstFetch('Doctrine\\DBAL\\Types\\Type', 'TARRAY', 'Doctrine\\DBAL\\Types\\Types', 'ARRAY'), - new RenameClassAndConstFetch( - 'Doctrine\\DBAL\\Types\\Type', - 'SIMPLE_ARRAY', - 'Doctrine\\DBAL\\Types\\Types', - 'SIMPLE_ARRAY' - ), - new RenameClassAndConstFetch( - 'Doctrine\\DBAL\\Types\\Type', - 'JSON_ARRAY', - 'Doctrine\\DBAL\\Types\\Types', - 'JSON_ARRAY' - ), - new RenameClassAndConstFetch('Doctrine\\DBAL\\Types\\Type', 'JSON', 'Doctrine\\DBAL\\Types\\Types', 'JSON'), - new RenameClassAndConstFetch('Doctrine\\DBAL\\Types\\Type', 'BIGINT', 'Doctrine\\DBAL\\Types\\Types', 'BIGINT'), - new RenameClassAndConstFetch( - 'Doctrine\\DBAL\\Types\\Type', - 'BOOLEAN', - 'Doctrine\\DBAL\\Types\\Types', - 'BOOLEAN' - ), - new RenameClassAndConstFetch( - 'Doctrine\\DBAL\\Types\\Type', - 'DATETIME', - 'Doctrine\\DBAL\\Types\\Types', - 'DATETIME_MUTABLE' - ), - new RenameClassAndConstFetch( - 'Doctrine\\DBAL\\Types\\Type', - 'DATETIME_IMMUTABLE', - 'Doctrine\\DBAL\\Types\\Types', - 'DATETIME_IMMUTABLE' - ), - new RenameClassAndConstFetch( - 'Doctrine\\DBAL\\Types\\Type', - 'DATETIMETZ', - 'Doctrine\\DBAL\\Types\\Types', - 'DATETIMETZ_MUTABLE' - ), - new RenameClassAndConstFetch( - 'Doctrine\\DBAL\\Types\\Type', - 'DATETIMETZ_IMMUTABLE', - 'Doctrine\\DBAL\\Types\\Types', - 'DATETIMETZ_IMMUTABLE' - ), - new RenameClassAndConstFetch( - 'Doctrine\\DBAL\\Types\\Type', - 'DATE', - 'Doctrine\\DBAL\\Types\\Types', - 'DATE_MUTABLE' - ), - new RenameClassAndConstFetch( - 'Doctrine\\DBAL\\Types\\Type', - 'DATE_IMMUTABLE', - 'Doctrine\\DBAL\\Types\\Types', - 'DATE_IMMUTABLE' - ), - new RenameClassAndConstFetch( - 'Doctrine\\DBAL\\Types\\Type', - 'TIME', - 'Doctrine\\DBAL\\Types\\Types', - 'TIME_MUTABLE' - ), - new RenameClassAndConstFetch( - 'Doctrine\\DBAL\\Types\\Type', - 'TIME_IMMUTABLE', - 'Doctrine\\DBAL\\Types\\Types', - 'TIME_IMMUTABLE' - ), - new RenameClassAndConstFetch( - 'Doctrine\\DBAL\\Types\\Type', - 'DECIMAL', - 'Doctrine\\DBAL\\Types\\Types', - 'DECIMAL' - ), - new RenameClassAndConstFetch( - 'Doctrine\\DBAL\\Types\\Type', - 'INTEGER', - 'Doctrine\\DBAL\\Types\\Types', - 'INTEGER' - ), - new RenameClassAndConstFetch('Doctrine\\DBAL\\Types\\Type', 'OBJECT', 'Doctrine\\DBAL\\Types\\Types', 'OBJECT'), - new RenameClassAndConstFetch( - 'Doctrine\\DBAL\\Types\\Type', - 'SMALLINT', - 'Doctrine\\DBAL\\Types\\Types', - 'SMALLINT' - ), - new RenameClassAndConstFetch('Doctrine\\DBAL\\Types\\Type', 'STRING', 'Doctrine\\DBAL\\Types\\Types', 'STRING'), - new RenameClassAndConstFetch('Doctrine\\DBAL\\Types\\Type', 'TEXT', 'Doctrine\\DBAL\\Types\\Types', 'TEXT'), - new RenameClassAndConstFetch('Doctrine\\DBAL\\Types\\Type', 'BINARY', 'Doctrine\\DBAL\\Types\\Types', 'BINARY'), - new RenameClassAndConstFetch('Doctrine\\DBAL\\Types\\Type', 'BLOB', 'Doctrine\\DBAL\\Types\\Types', 'BLOB'), - new RenameClassAndConstFetch('Doctrine\\DBAL\\Types\\Type', 'FLOAT', 'Doctrine\\DBAL\\Types\\Types', 'FLOAT'), - new RenameClassAndConstFetch('Doctrine\\DBAL\\Types\\Type', 'GUID', 'Doctrine\\DBAL\\Types\\Types', 'GUID'), - new RenameClassAndConstFetch( - 'Doctrine\\DBAL\\Types\\Type', - 'DATEINTERVAL', - 'Doctrine\\DBAL\\Types\\Types', - 'DATEINTERVAL' - ), - ]); - - $rectorConfig->ruleWithConfiguration(RenameMethodRector::class, [ - // https://github.com/doctrine/dbal/blob/master/UPGRADE.md#deprecations-in-the-wrapper-connection-class - new MethodCallRename('Doctrine\DBAL\Connection', 'executeUpdate', 'executeStatement'), - new MethodCallRename('Doctrine\DBAL\Connection', 'exec', 'executeStatement'), - new MethodCallRename('Doctrine\DBAL\Connection', 'query', 'executeQuery'), - // https://github.com/doctrine/dbal/blob/master/UPGRADE.md#driverexceptiongeterrorcode-is-deprecated - new MethodCallRename('Doctrine\DBAL\Driver\DriverException', 'getErrorCode', 'getSQLState'), - // https://github.com/doctrine/dbal/blob/master/UPGRADE.md#deprecated-expressionbuilder-methods - new MethodCallRename('Doctrine\DBAL\Query\Expression\ExpressionBuilder', 'andX', 'and'), - new MethodCallRename('Doctrine\DBAL\Query\Expression\ExpressionBuilder', 'orX', 'or'), - // https://github.com/doctrine/dbal/blob/master/UPGRADE.md#deprecated-compositeexpression-methods - new MethodCallRename('Doctrine\DBAL\Query\Expression\CompositeExpression', 'add', 'with'), - new MethodCallRename('Doctrine\DBAL\Query\Expression\CompositeExpression', 'addMultiple', 'with'), - // https://github.com/doctrine/dbal/blob/master/UPGRADE.md#deprecated-fetchmode-and-the-corresponding-methods - new MethodCallRename('Doctrine\DBAL\Connection', 'fetchAssoc', 'fetchAssociative'), - new MethodCallRename('Doctrine\DBAL\Connection', 'fetchArray', 'fetchNumeric'), - new MethodCallRename('Doctrine\DBAL\Connection', 'fetchColumn', 'fetchOne'), - new MethodCallRename('Doctrine\DBAL\Connection', 'fetchAll', 'fetchAllAssociative'), - new MethodCallRename('Doctrine\DBAL\Statement', 'fetchAssoc', 'fetchAssociative'), - new MethodCallRename('Doctrine\DBAL\Statement', 'fetchColumn', 'fetchOne'), - new MethodCallRename('Doctrine\DBAL\Statement', 'fetchAll', 'fetchAllAssociative'), - new MethodCallRename('Doctrine\DBAL\Result', 'fetchAssoc', 'fetchAssociative'), - new MethodCallRename('Doctrine\DBAL\Result', 'fetchArray', 'fetchNumeric'), - new MethodCallRename('Doctrine\DBAL\Result', 'fetchColumn', 'fetchOne'), - new MethodCallRename('Doctrine\DBAL\Result', 'fetchAll', 'fetchAllAssociative'), - ]); - - $rectorConfig->ruleWithConfiguration(RenameClassRector::class, [ - // https://github.com/doctrine/dbal/blob/master/UPGRADE.md#pdo-related-classes-outside-of-the-pdo-namespace-are-deprecated - 'Doctrine\DBAL\Driver\PDOMySql\Driver' => 'Doctrine\DBAL\Driver\PDO\MySQL\Driver', - 'Doctrine\DBAL\Driver\PDOOracle\Driver' => 'Doctrine\DBAL\Driver\PDO\OCI\Driver', - 'Doctrine\DBAL\Driver\PDOPgSql\Driver' => 'Doctrine\DBAL\Driver\PDO\PgSQL\Driver', - 'Doctrine\DBAL\Driver\PDOSqlite\Driver' => 'Doctrine\DBAL\Driver\PDO\SQLite\Driver', - 'Doctrine\DBAL\Driver\PDOSqlsrv\Driver' => 'Doctrine\DBAL\Driver\PDO\SQLSrv\Driver', - 'Doctrine\DBAL\Driver\PDOSqlsrv\Connection' => 'Doctrine\DBAL\Driver\PDO\SQLSrv\Connection', - 'Doctrine\DBAL\Driver\PDOSqlsrv\Statement' => 'Doctrine\DBAL\Driver\PDO\SQLSrv\Statement', - // https://github.com/doctrine/dbal/blob/master/UPGRADE.md#deprecated-dbalexception - 'Doctrine\DBAL\DBALException' => 'Doctrine\DBAL\Exception', - // https://github.com/doctrine/dbal/blob/master/UPGRADE.md#inconsistently-and-ambiguously-named-driver-level-classes-are-deprecated - 'Doctrine\DBAL\Driver\DriverException' => 'Doctrine\DBAL\Driver\Exception', - 'Doctrine\DBAL\Driver\AbstractDriverException' => 'Doctrine\DBAL\Driver\AbstractException', - 'Doctrine\DBAL\Driver\IBMDB2\DB2Driver' => 'Doctrine\DBAL\Driver\IBMDB2\Driver', - 'Doctrine\DBAL\Driver\IBMDB2\DB2Connection' => 'Doctrine\DBAL\Driver\IBMDB2\Connection', - 'Doctrine\DBAL\Driver\IBMDB2\DB2Statement' => 'Doctrine\DBAL\Driver\IBMDB2\Statement', - 'Doctrine\DBAL\Driver\Mysqli\MysqliConnection' => 'Doctrine\DBAL\Driver\Mysqli\Connection', - 'Doctrine\DBAL\Driver\Mysqli\MysqliStatement' => 'Doctrine\DBAL\Driver\Mysqli\Statement', - 'Doctrine\DBAL\Driver\OCI8\OCI8Connection' => 'Doctrine\DBAL\Driver\OCI8\Connection', - 'Doctrine\DBAL\Driver\OCI8\OCI8Statement' => 'Doctrine\DBAL\Driver\OCI8\Statement', - 'Doctrine\DBAL\Driver\SQLSrv\SQLSrvConnection' => 'Doctrine\DBAL\Driver\SQLSrv\Connection', - 'Doctrine\DBAL\Driver\SQLSrv\SQLSrvStatement' => 'Doctrine\DBAL\Driver\SQLSrv\Statement', - 'Doctrine\DBAL\Driver\PDOConnection' => 'Doctrine\DBAL\Driver\PDO\Connection', - 'Doctrine\DBAL\Driver\PDOStatement' => 'Doctrine\DBAL\Driver\PDO\Statement', - // https://github.com/doctrine/dbal/blob/master/UPGRADE.md#deprecated-masterslaveconnection-use-primaryreadreplicaconnection - 'Doctrine\DBAL\Connections\MasterSlaveConnection' => 'Doctrine\DBAL\Connections\PrimaryReadReplicaConnection', - ]); - - $rectorConfig->rules([ - // https://github.com/doctrine/dbal/pull/3853 - // https://github.com/doctrine/dbal/issues/3837 - ExtractArrayArgOnQueryBuilderSelectRector::class, - - ReplaceFetchAllMethodCallRector::class, - ]); -}; diff --git a/config/sets/doctrine-dbal-30.php b/config/sets/doctrine-dbal-30.php deleted file mode 100644 index d26c4efe..00000000 --- a/config/sets/doctrine-dbal-30.php +++ /dev/null @@ -1,33 +0,0 @@ -ruleWithConfiguration(RenameMethodRector::class, [ - new MethodCallRename( - 'Doctrine\DBAL\Platforms\AbstractPlatform', - 'getVarcharTypeDeclarationSQL', - 'getStringTypeDeclarationSQL' - ), - new MethodCallRename('Doctrine\DBAL\Driver\DriverException', 'getErrorCode', 'getCode'), - ]); - - $rectorConfig->ruleWithConfiguration( - AddReturnTypeDeclarationRector::class, - [new AddReturnTypeDeclaration('Doctrine\DBAL\Connection', 'ping', new VoidType())] - ); - - # https://github.com/doctrine/dbal/blob/master/UPGRADE.md#deprecated-abstractionresult - $rectorConfig->ruleWithConfiguration(RenameClassRector::class, [ - 'Doctrine\DBAL\Abstraction\Result' => 'Doctrine\DBAL\Result', - ]); -}; diff --git a/config/sets/doctrine-dbal-38.php b/config/sets/doctrine-dbal-38.php deleted file mode 100644 index 042e605a..00000000 --- a/config/sets/doctrine-dbal-38.php +++ /dev/null @@ -1,10 +0,0 @@ -rule(MigrateQueryBuilderResetQueryPartRector::class); -}; diff --git a/config/sets/doctrine-dbal-40.php b/config/sets/doctrine-dbal-40.php deleted file mode 100644 index 3f3f85c3..00000000 --- a/config/sets/doctrine-dbal-40.php +++ /dev/null @@ -1,77 +0,0 @@ -rules([ - // @see https://github.com/doctrine/dbal/blob/4.0.x/UPGRADE.md#bc-break-removed-compositeexpression-methods - ChangeCompositeExpressionAddMultipleWithWithRector::class, - - // @see https://github.com/doctrine/dbal/pull/5556 - ExecuteQueryParamsToBindValueRector::class, - ]); - - $rectorConfig->ruleWithConfiguration(RenameMethodRector::class, [ - // @see https://github.com/doctrine/dbal/blob/4.0.x/UPGRADE.md#bc-break-removed-misspelled-isfullfilledby-method - new MethodCallRename('Doctrine\DBAL\Schema\Index', 'isFullfilledBy', 'isFulfilledBy'), - // @see https://github.com/doctrine/dbal/blob/4.0.x/UPGRADE.md#bc-break-removed-expressionbuilder-methods - new MethodCallRename('Doctrine\DBAL\Query\Expression\ExpressionBuilder', 'andX', 'and'), - new MethodCallRename('Doctrine\DBAL\Query\Expression\ExpressionBuilder', 'orX', 'or'), - // @see https://github.com/doctrine/dbal/blob/4.0.x/UPGRADE.md#bc-break-removed-compositeexpression-methods - new MethodCallRename('Doctrine\DBAL\Query\Expression\CompositeExpression', 'add', 'with'), - // @see https://github.com/doctrine/dbal/blob/4.0.x/UPGRADE.md#bc-break-removal-of-doctrine-cache - new MethodCallRename('Doctrine\DBAL\Configuration', 'setResultCacheImpl', 'setResultCache'), - new MethodCallRename('Doctrine\DBAL\Configuration', 'getResultCacheImpl', 'getResultCache'), - new MethodCallRename('Doctrine\DBAL\QueryCacheProfile', 'setResultCacheDriver', 'setResultCache'), - new MethodCallRename('Doctrine\DBAL\QueryCacheProfile', 'getResultCacheDriver', 'getResultCache'), - ]); - - $rectorConfig->ruleWithConfiguration(RenameClassRector::class, [ - // @see https://github.com/doctrine/dbal/blob/4.0.x/UPGRADE.md#bc-break-renamed-sqlite-platform-classes - 'Doctrine\DBAL\Platforms\SqlitePlatform' => 'Doctrine\DBAL\Platforms\SQLitePlatform', - 'Doctrine\DBAL\Schema\SqliteSchemaManager' => 'Doctrine\DBAL\Schema\SQLiteSchemaManager', - ]); - - $rectorConfig->ruleWithConfiguration( - RenameClassConstFetchRector::class, - [ - // @see https://github.com/doctrine/dbal/blob/4.0.x/UPGRADE.md#bc-break-removed-connectionparam__array-constants - new RenameClassAndConstFetch( - 'Doctrine\DBAL\Connection', - 'PARAM_STR_ARRAY', - 'Doctrine\DBAL\ArrayParameterType', - 'STRING' - ), - ] - ); - - $rectorConfig->ruleWithConfiguration( - RenameClassConstFetchRector::class, - [ - // @see https://github.com/doctrine/dbal/blob/4.0.x/UPGRADE.md#bc-break-removed-connectionparam__array-constants - new RenameClassAndConstFetch( - 'Doctrine\DBAL\Connection', - 'PARAM_INT_ARRAY', - 'Doctrine\DBAL\ArrayParameterType', - 'INTEGER' - ), - ] - ); - - $rectorConfig->ruleWithConfiguration( - RenameMethodRector::class, - [ - // @see https://github.com/doctrine/dbal/blob/4.0.x/UPGRADE.md#bc-break-removed-connection_schemamanager-and-connectiongetschemamanager - new MethodCallRename('Doctrine\DBAL\Connection', 'getSchemaManager', 'createSchemaManager'), - ] - ); -}; diff --git a/config/sets/doctrine-dbal-42.php b/config/sets/doctrine-dbal-42.php deleted file mode 100644 index 78255940..00000000 --- a/config/sets/doctrine-dbal-42.php +++ /dev/null @@ -1,13 +0,0 @@ -rules([ - // @see https://github.com/doctrine/dbal/pull/6504/files - AddArrayResultColumnNamesRector::class, - ]); -}; diff --git a/config/sets/doctrine-mongodb-odm-216.php b/config/sets/doctrine-mongodb-odm-216.php deleted file mode 100644 index c7509f8f..00000000 --- a/config/sets/doctrine-mongodb-odm-216.php +++ /dev/null @@ -1,192 +0,0 @@ -ruleWithConfiguration(RenameAttributeRector::class, [ - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\File\ChunkSize', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\File\ChunkSize', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\File\Filename', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\File\Filename', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\File\Length', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\File\Length', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\File\Metadata', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\File\Metadata', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\File\UploadDate', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\File\UploadDate', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\AlsoLoad', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\AlsoLoad', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\ChangeTrackingPolicy', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\ChangeTrackingPolicy', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\DefaultDiscriminatorValue', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\DefaultDiscriminatorValue', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\DiscriminatorField', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\DiscriminatorField', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\DiscriminatorMap', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\DiscriminatorMap', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\DiscriminatorValue', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\DiscriminatorValue', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\Document', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\Document', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\EmbeddedDocument', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\EmbeddedDocument', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\EmbedMany', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\EmbedMany', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\EmbedOne', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\EmbedOne', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\Encrypt', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\Encrypt', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\Field', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\Field', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\File', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\File', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\HasLifecycleCallbacks', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\HasLifecycleCallbacks', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\Id', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\Id', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\Index', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\Index', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\InheritanceType', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\InheritanceType', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\Lock', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\Lock', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\MappedSuperclass', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\MappedSuperclass', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\PostLoad', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\PostLoad', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\PostPersist', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\PostPersist', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\PostRemove', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\PostRemove', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\PostUpdate', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\PostUpdate', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\PreFlush', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\PreFlush', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\PreLoad', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\PreLoad', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\PrePersist', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\PrePersist', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\PreRemove', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\PreRemove', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\PreUpdate', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\PreUpdate', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\QueryResultDocument', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\QueryResultDocument', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\ReadPreference', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\ReadPreference', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\ReferenceMany', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\ReferenceMany', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\ReferenceOne', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\ReferenceOne', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\SearchIndex', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\SearchIndex', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\ShardKey', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\ShardKey', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\TimeSeries', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\TimeSeries', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\UniqueIndex', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\UniqueIndex', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\Validation', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\Validation', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\VectorSearchIndex', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\VectorSearchIndex', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\Version', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\Version', - ), - new RenameAttribute( - 'Doctrine\ODM\MongoDB\Mapping\Annotations\View', - 'Doctrine\ODM\MongoDB\Mapping\Attribute\View', - ), - ]); -}; diff --git a/config/sets/doctrine-orm-213.php b/config/sets/doctrine-orm-213.php deleted file mode 100644 index 9d3815e9..00000000 --- a/config/sets/doctrine-orm-213.php +++ /dev/null @@ -1,33 +0,0 @@ -ruleWithConfiguration( - RenameMethodRector::class, - [ - // @see https://github.com/doctrine/orm/pull/9876 - new MethodCallRename('Doctrine\ORM\Event\LifecycleEventArgs', 'getEntityManager', 'getObjectManager'), - new MethodCallRename('Doctrine\ORM\Event\OnClearEventArgs', 'getEntityManager', 'getObjectManager'), - new MethodCallRename('Doctrine\ORM\Event\OnFlushEventArgs', 'getEntityManager', 'getObjectManager'), - new MethodCallRename('Doctrine\ORM\Event\PostFlushEventArgs', 'getEntityManager', 'getObjectManager'), - new MethodCallRename('Doctrine\ORM\Event\PreFlushEventArgs', 'getEntityManager', 'getObjectManager'), - // @see https://github.com/doctrine/orm/pull/9906 - new MethodCallRename('Doctrine\ORM\Event\LifecycleEventArgs', 'getEntity', 'getObject'), - // @see https://github.com/doctrine/dbal/pull/4580 - new MethodCallRename('Doctrine\DBAL\Statement', 'execute', 'executeQuery'), - ], - ); - $rectorConfig->ruleWithConfiguration( - RenameClassRector::class, - [ - // @see https://github.com/doctrine/orm/pull/9906 - 'Doctrine\ORM\Event\LifecycleEventArgs' => 'Doctrine\Persistence\Event\LifecycleEventArgs', - ], - ); -}; diff --git a/config/sets/doctrine-orm-214.php b/config/sets/doctrine-orm-214.php deleted file mode 100644 index 2be98420..00000000 --- a/config/sets/doctrine-orm-214.php +++ /dev/null @@ -1,10 +0,0 @@ -rule(ReplaceLifecycleEventArgsByDedicatedEventArgsRector::class); -}; diff --git a/config/sets/doctrine-orm-219.php b/config/sets/doctrine-orm-219.php deleted file mode 100644 index a8ea26b3..00000000 --- a/config/sets/doctrine-orm-219.php +++ /dev/null @@ -1,459 +0,0 @@ -sets([DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES]); - - $rectorConfig->ruleWithConfiguration(RenameClassConstFetchRector::class, [ - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_NONE', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_NONE' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_INTEGER', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_INTEGER' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_STRING', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_STRING' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_INPUT_PARAMETER', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_INPUT_PARAMETER' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_FLOAT', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_FLOAT' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_CLOSE_PARENTHESIS', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_CLOSE_PARENTHESIS' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_OPEN_PARENTHESIS', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_OPEN_PARENTHESIS' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_COMMA', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_COMMA' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_DIVIDE', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_DIVIDE' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_DOT', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_DOT' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_EQUALS', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_EQUALS' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_GREATER_THAN', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_GREATER_THAN' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_LOWER_THAN', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_LOWER_THAN' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_MINUS', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_MINUS' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_MULTIPLY', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_MULTIPLY' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_NEGATE', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_NEGATE' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_PLUS', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_PLUS' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_OPEN_CURLY_BRACE', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_OPEN_CURLY_BRACE' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_CLOSE_CURLY_BRACE', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_CLOSE_CURLY_BRACE' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_ALIASED_NAME', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_ALIASED_NAME' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_FULLY_QUALIFIED_NAME', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_FULLY_QUALIFIED_NAME' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_IDENTIFIER', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_IDENTIFIER' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_ALL', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_ALL' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_AND', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_AND' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_ANY', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_ANY' - ), - new RenameClassAndConstFetch('Doctrine\\ORM\\Query\\Lexer', 'T_AS', 'Doctrine\\ORM\\Query\\TokenType', 'T_AS'), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_ASC', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_ASC' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_AVG', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_AVG' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_BETWEEN', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_BETWEEN' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_BOTH', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_BOTH' - ), - new RenameClassAndConstFetch('Doctrine\\ORM\\Query\\Lexer', 'T_BY', 'Doctrine\\ORM\\Query\\TokenType', 'T_BY'), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_CASE', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_CASE' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_COALESCE', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_COALESCE' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_COUNT', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_COUNT' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_DELETE', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_DELETE' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_DESC', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_DESC' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_DISTINCT', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_DISTINCT' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_ELSE', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_ELSE' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_EMPTY', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_EMPTY' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_END', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_END' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_ESCAPE', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_ESCAPE' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_EXISTS', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_EXISTS' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_FALSE', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_FALSE' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_FROM', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_FROM' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_GROUP', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_GROUP' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_HAVING', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_HAVING' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_HIDDEN', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_HIDDEN' - ), - new RenameClassAndConstFetch('Doctrine\\ORM\\Query\\Lexer', 'T_IN', 'Doctrine\\ORM\\Query\\TokenType', 'T_IN'), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_INDEX', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_INDEX' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_INNER', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_INNER' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_INSTANCE', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_INSTANCE' - ), - new RenameClassAndConstFetch('Doctrine\\ORM\\Query\\Lexer', 'T_IS', 'Doctrine\\ORM\\Query\\TokenType', 'T_IS'), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_JOIN', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_JOIN' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_LEADING', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_LEADING' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_LEFT', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_LEFT' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_LIKE', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_LIKE' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_MAX', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_MAX' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_MEMBER', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_MEMBER' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_MIN', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_MIN' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_NEW', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_NEW' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_NOT', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_NOT' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_NULL', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_NULL' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_NULLIF', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_NULLIF' - ), - new RenameClassAndConstFetch('Doctrine\\ORM\\Query\\Lexer', 'T_OF', 'Doctrine\\ORM\\Query\\TokenType', 'T_OF'), - new RenameClassAndConstFetch('Doctrine\\ORM\\Query\\Lexer', 'T_OR', 'Doctrine\\ORM\\Query\\TokenType', 'T_OR'), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_ORDER', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_ORDER' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_OUTER', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_OUTER' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_PARTIAL', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_PARTIAL' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_SELECT', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_SELECT' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_SET', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_SET' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_SOME', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_SOME' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_SUM', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_SUM' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_THEN', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_THEN' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_TRAILING', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_TRAILING' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_TRUE', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_TRUE' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_UPDATE', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_UPDATE' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_WHEN', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_WHEN' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_WHERE', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_WHERE' - ), - new RenameClassAndConstFetch( - 'Doctrine\\ORM\\Query\\Lexer', - 'T_WITH', - 'Doctrine\\ORM\\Query\\TokenType', - 'T_WITH' - ), - ]); -}; diff --git a/config/sets/doctrine-orm-25.php b/config/sets/doctrine-orm-25.php deleted file mode 100644 index 6d3a8b33..00000000 --- a/config/sets/doctrine-orm-25.php +++ /dev/null @@ -1,36 +0,0 @@ -ruleWithConfiguration(AddParamTypeDeclarationRector::class, [ - new AddParamTypeDeclaration( - 'Doctrine\ORM\Mapping\ClassMetadataFactory', - 'setEntityManager', - 0, - new ObjectType('Doctrine\ORM\EntityManagerInterface') - ), - new AddParamTypeDeclaration( - 'Doctrine\ORM\Tools\DebugUnitOfWorkListener', - 'dumpIdentityMap', - 0, - new ObjectType('Doctrine\ORM\EntityManagerInterface') - ), - ]); - - $rectorConfig->ruleWithConfiguration(ArgumentRemoverRector::class, [ - new ArgumentRemover( - 'Doctrine\ORM\Persisters\Entity\AbstractEntityInheritancePersister', - 'getSelectJoinColumnSQL', - 4, - null - ), - ]); -}; diff --git a/config/sets/doctrine-orm-28.php b/config/sets/doctrine-orm-28.php deleted file mode 100644 index a56fcb25..00000000 --- a/config/sets/doctrine-orm-28.php +++ /dev/null @@ -1,11 +0,0 @@ -rule(IterateToToIterableRector::class); -}; diff --git a/config/sets/doctrine-orm-300.php b/config/sets/doctrine-orm-300.php deleted file mode 100644 index 62dfc1ca..00000000 --- a/config/sets/doctrine-orm-300.php +++ /dev/null @@ -1,16 +0,0 @@ -rules([SetParametersArrayToCollectionRector::class, CastDoctrineExprToStringRector::class]); - - $rectorConfig->ruleWithConfiguration(RenameClassRector::class, [ - 'Doctrine\ORM\ORMException' => 'Doctrine\ORM\Exception\ORMException', - ]); -}; diff --git a/src/Set/DoctrineSetList.php b/src/Set/DoctrineSetList.php index fa31ae95..d794d94e 100644 --- a/src/Set/DoctrineSetList.php +++ b/src/Set/DoctrineSetList.php @@ -4,8 +4,6 @@ namespace Rector\Doctrine\Set; -use Deprecated; - /** * @api */ From 2fa5b254e0dfc754e8cf28c0ffdfcdb46af31760 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Fri, 7 Aug 2026 11:22:40 +0200 Subject: [PATCH 4/4] update tests to use composer.json --- .../Set/DoctrineBUNDLE210Set/DoctrineBUNDLE210SetTest.php | 8 ++++++++ tests/Set/DoctrineBUNDLE210Set/config/composer.json | 5 +++++ tests/Set/DoctrineBUNDLE210Set/config/configured_set.php | 2 +- .../DoctrineCOLLECTION22SetTest.php | 8 ++++++++ tests/Set/DoctrineCOLLECTION22Set/config/composer.json | 5 +++++ .../Set/DoctrineCOLLECTION22Set/config/configured_set.php | 2 +- tests/Set/DoctrineDBAL211Set/DoctrineDBAL211SetTest.php | 8 ++++++++ tests/Set/DoctrineDBAL211Set/config/composer.json | 5 +++++ tests/Set/DoctrineDBAL211Set/config/configured_set.php | 2 +- tests/Set/DoctrineORM219Set/DoctrineORM219SetTest.php | 8 ++++++++ tests/Set/DoctrineORM219Set/Php81NestedAttributesTest.php | 8 ++++++++ tests/Set/DoctrineORM219Set/config/composer.json | 5 +++++ tests/Set/DoctrineORM219Set/config/configured_set.php | 2 +- .../DoctrineORM219Set/config/php81_nested_attributes.php | 2 +- 14 files changed, 65 insertions(+), 5 deletions(-) create mode 100644 tests/Set/DoctrineBUNDLE210Set/config/composer.json create mode 100644 tests/Set/DoctrineCOLLECTION22Set/config/composer.json create mode 100644 tests/Set/DoctrineDBAL211Set/config/composer.json create mode 100644 tests/Set/DoctrineORM219Set/config/composer.json diff --git a/tests/Set/DoctrineBUNDLE210Set/DoctrineBUNDLE210SetTest.php b/tests/Set/DoctrineBUNDLE210Set/DoctrineBUNDLE210SetTest.php index d4e91d66..7d19c219 100644 --- a/tests/Set/DoctrineBUNDLE210Set/DoctrineBUNDLE210SetTest.php +++ b/tests/Set/DoctrineBUNDLE210Set/DoctrineBUNDLE210SetTest.php @@ -25,4 +25,12 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_set.php'; } + + /** + * The composer-based set rules are bound to the Doctrine package versions in this "composer.json" + */ + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/tests/Set/DoctrineBUNDLE210Set/config/composer.json b/tests/Set/DoctrineBUNDLE210Set/config/composer.json new file mode 100644 index 00000000..50a07c63 --- /dev/null +++ b/tests/Set/DoctrineBUNDLE210Set/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "doctrine/doctrine-bundle": "^2.10" + } +} diff --git a/tests/Set/DoctrineBUNDLE210Set/config/configured_set.php b/tests/Set/DoctrineBUNDLE210Set/config/configured_set.php index 568f75db..f5135d96 100644 --- a/tests/Set/DoctrineBUNDLE210Set/config/configured_set.php +++ b/tests/Set/DoctrineBUNDLE210Set/config/configured_set.php @@ -5,5 +5,5 @@ use Rector\Config\RectorConfig; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->sets([__DIR__ . '/../../../../config/sets/doctrine-bundle-28.php']); + $rectorConfig->sets([__DIR__ . '/../../../../config/sets/composer-based.php']); }; diff --git a/tests/Set/DoctrineCOLLECTION22Set/DoctrineCOLLECTION22SetTest.php b/tests/Set/DoctrineCOLLECTION22Set/DoctrineCOLLECTION22SetTest.php index 10c049cf..8e072724 100644 --- a/tests/Set/DoctrineCOLLECTION22Set/DoctrineCOLLECTION22SetTest.php +++ b/tests/Set/DoctrineCOLLECTION22Set/DoctrineCOLLECTION22SetTest.php @@ -15,6 +15,14 @@ public function provideConfigFilePath(): string return __DIR__ . '/config/configured_set.php'; } + /** + * The composer-based set rules are bound to the Doctrine package versions in this "composer.json" + */ + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } + public static function provideData(): Iterator { return self::yieldFilesFromDirectory(__DIR__ . '/Fixture'); diff --git a/tests/Set/DoctrineCOLLECTION22Set/config/composer.json b/tests/Set/DoctrineCOLLECTION22Set/config/composer.json new file mode 100644 index 00000000..ae640d7e --- /dev/null +++ b/tests/Set/DoctrineCOLLECTION22Set/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "doctrine/collections": "^2.2" + } +} diff --git a/tests/Set/DoctrineCOLLECTION22Set/config/configured_set.php b/tests/Set/DoctrineCOLLECTION22Set/config/configured_set.php index c5c2dbc0..f5135d96 100644 --- a/tests/Set/DoctrineCOLLECTION22Set/config/configured_set.php +++ b/tests/Set/DoctrineCOLLECTION22Set/config/configured_set.php @@ -5,5 +5,5 @@ use Rector\Config\RectorConfig; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->sets([__DIR__ . '/../../../../config/sets/doctrine-collection-22.php']); + $rectorConfig->sets([__DIR__ . '/../../../../config/sets/composer-based.php']); }; diff --git a/tests/Set/DoctrineDBAL211Set/DoctrineDBAL211SetTest.php b/tests/Set/DoctrineDBAL211Set/DoctrineDBAL211SetTest.php index 83cca153..b8bbf6b1 100644 --- a/tests/Set/DoctrineDBAL211Set/DoctrineDBAL211SetTest.php +++ b/tests/Set/DoctrineDBAL211Set/DoctrineDBAL211SetTest.php @@ -25,4 +25,12 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_set.php'; } + + /** + * The composer-based set rules are bound to the Doctrine package versions in this "composer.json" + */ + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/tests/Set/DoctrineDBAL211Set/config/composer.json b/tests/Set/DoctrineDBAL211Set/config/composer.json new file mode 100644 index 00000000..296545ee --- /dev/null +++ b/tests/Set/DoctrineDBAL211Set/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "doctrine/dbal": "^2.11" + } +} diff --git a/tests/Set/DoctrineDBAL211Set/config/configured_set.php b/tests/Set/DoctrineDBAL211Set/config/configured_set.php index 25e0106b..f5135d96 100644 --- a/tests/Set/DoctrineDBAL211Set/config/configured_set.php +++ b/tests/Set/DoctrineDBAL211Set/config/configured_set.php @@ -5,5 +5,5 @@ use Rector\Config\RectorConfig; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->sets([__DIR__ . '/../../../../config/sets/doctrine-dbal-211.php']); + $rectorConfig->sets([__DIR__ . '/../../../../config/sets/composer-based.php']); }; diff --git a/tests/Set/DoctrineORM219Set/DoctrineORM219SetTest.php b/tests/Set/DoctrineORM219Set/DoctrineORM219SetTest.php index 47f6a4f6..d57232c3 100644 --- a/tests/Set/DoctrineORM219Set/DoctrineORM219SetTest.php +++ b/tests/Set/DoctrineORM219Set/DoctrineORM219SetTest.php @@ -25,4 +25,12 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_set.php'; } + + /** + * The composer-based set rules are bound to the Doctrine package versions in this "composer.json" + */ + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/tests/Set/DoctrineORM219Set/Php81NestedAttributesTest.php b/tests/Set/DoctrineORM219Set/Php81NestedAttributesTest.php index 739a9ab3..414e42c8 100644 --- a/tests/Set/DoctrineORM219Set/Php81NestedAttributesTest.php +++ b/tests/Set/DoctrineORM219Set/Php81NestedAttributesTest.php @@ -25,4 +25,12 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/php81_nested_attributes.php'; } + + /** + * The composer-based set rules are bound to the Doctrine package versions in this "composer.json" + */ + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/tests/Set/DoctrineORM219Set/config/composer.json b/tests/Set/DoctrineORM219Set/config/composer.json new file mode 100644 index 00000000..78cf0a84 --- /dev/null +++ b/tests/Set/DoctrineORM219Set/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "doctrine/orm": "^2.19" + } +} diff --git a/tests/Set/DoctrineORM219Set/config/configured_set.php b/tests/Set/DoctrineORM219Set/config/configured_set.php index 3e87f306..fccd966c 100644 --- a/tests/Set/DoctrineORM219Set/config/configured_set.php +++ b/tests/Set/DoctrineORM219Set/config/configured_set.php @@ -6,7 +6,7 @@ use Rector\ValueObject\PhpVersionFeature; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->sets([__DIR__ . '/../../../../config/sets/doctrine-orm-219.php']); + $rectorConfig->sets([__DIR__ . '/../../../../config/sets/composer-based.php']); $rectorConfig->phpVersion(PhpVersionFeature::NEW_INITIALIZERS - 1); }; diff --git a/tests/Set/DoctrineORM219Set/config/php81_nested_attributes.php b/tests/Set/DoctrineORM219Set/config/php81_nested_attributes.php index bfc6f7c8..6ba50c3e 100644 --- a/tests/Set/DoctrineORM219Set/config/php81_nested_attributes.php +++ b/tests/Set/DoctrineORM219Set/config/php81_nested_attributes.php @@ -6,7 +6,7 @@ use Rector\ValueObject\PhpVersionFeature; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->sets([__DIR__ . '/../../../../config/sets/doctrine-orm-219.php']); + $rectorConfig->sets([__DIR__ . '/../../../../config/sets/composer-based.php']); $rectorConfig->phpVersion(PhpVersionFeature::NEW_INITIALIZERS); };