From f7e9d49b9d4aa5c6c24551e0a4d88a9a0ed7e370 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Tue, 12 Dec 2023 11:17:49 +0100 Subject: [PATCH 1/3] Remove CHANGELOG and old UPGRADE files (#803) --- CHANGELOG-4.0.md | 51 ------------------------------------------------ UPGRADE-3.5.md | 5 ----- UPGRADE-4.0.md | 15 -------------- UPGRADE-4.4.md | 26 ------------------------ UPGRADE-4.6.md | 7 ------- UPGRADE-4.7.md | 13 ------------ 6 files changed, 117 deletions(-) delete mode 100644 CHANGELOG-4.0.md delete mode 100644 UPGRADE-3.5.md delete mode 100644 UPGRADE-4.0.md delete mode 100644 UPGRADE-4.4.md delete mode 100644 UPGRADE-4.6.md delete mode 100644 UPGRADE-4.7.md diff --git a/CHANGELOG-4.0.md b/CHANGELOG-4.0.md deleted file mode 100644 index c2d9e647..00000000 --- a/CHANGELOG-4.0.md +++ /dev/null @@ -1,51 +0,0 @@ -CHANGELOG for 4.0.x -=================== - -4.0.0 (2019-10-02) ------------------- - -All issues and pull requests in this release may be found under the [4.0.0 milestone](https://github.com/doctrine/DoctrineMongoDBBundle/issues?q=milestone%3A4.0.0). - - - [588: Removing travis allow failure for php7.4](https://github.com/doctrine/DoctrineMongoDBBundle/pull/588) thanks to @ishyevandro and @carusogabriel - -4.0.0-RC3 (2019-09-30) ----------------------- - -All issues and pull requests in this release may be found under the [4.0.0-RC3 milestone](https://github.com/doctrine/DoctrineMongoDBBundle/issues?q=milestone%3A4.0.0-RC3). - - - [585: Fix wrong interface inheritance in command logger](https://github.com/doctrine/DoctrineMongoDBBundle/pull/585) thanks to @alcaeus and @lljaworski - -4.0.0-RC2 (2019-09-24) ----------------------- - -All issues and pull requests in this release may be found under the [4.0.0-RC2 milestone](https://github.com/doctrine/DoctrineMongoDBBundle/issues?q=milestone%3A4.0.0-RC2). - - - [583: Fix wrong driver options key](https://github.com/doctrine/DoctrineMongoDBBundle/pull/583) thanks to @alcaeus - - [569: Fix registration of command subscribers](https://github.com/doctrine/DoctrineMongoDBBundle/pull/569) thanks to @alcaeus and @markitosgv - - [581: Update outdated docs](https://github.com/doctrine/DoctrineMongoDBBundle/pull/581) thanks to @alcaeus and @malarzm - - [562: Remove mentions to removed option --fixtures](https://github.com/doctrine/DoctrineMongoDBBundle/pull/562) thanks to @tsantos84 - - [558: Fix ext-mongodb compatibility information](https://github.com/doctrine/DoctrineMongoDBBundle/pull/558) thanks to @teohhanhui - - [570: Use travis jobs in build pipeline](https://github.com/doctrine/DoctrineMongoDBBundle/pull/570) thanks to @alcaeus - -4.0.0-RC1 (2019-06-06) ----------------------- - -All issues and pull requests in this release may be found under the [4.0.0-RC1 milestone](https://github.com/doctrine/DoctrineMongoDBBundle/issues?q=milestone%3A4.0.0-RC1). - - - [556: Remove mocks to final class in tests](https://github.com/doctrine/DoctrineMongoDBBundle/pull/556) thanks to @alcaeus - - [555: Remove legacy alias for document manager](https://github.com/doctrine/DoctrineMongoDBBundle/pull/555) thanks to @alcaeus - - [545: Updated doctrine/coding-standard to 6.0](https://github.com/doctrine/DoctrineMongoDBBundle/pull/545) thanks to @patrickjahns - - [523: Load Tests with autoloader only in dev](https://github.com/doctrine/DoctrineMongoDBBundle/pull/523) thanks to @rvitaliy - - [522: added .gitattributes](https://github.com/doctrine/DoctrineMongoDBBundle/pull/522) thanks to @rvitaliy - - [515: Prepare bundle for ODM Beta 1](https://github.com/doctrine/DoctrineMongoDBBundle/pull/515) thanks to @alcaeus - - [484: Apply doctrine/coding-standard 5.0](https://github.com/doctrine/DoctrineMongoDBBundle/pull/484) thanks to @caciobanu and @alcaeus - - [480: Drop document generation commands](https://github.com/doctrine/DoctrineMongoDBBundle/issues/480) thanks to @alcaeus - - [554: Drop file fixtures in favour of fixture services](https://github.com/doctrine/DoctrineMongoDBBundle/pull/554) thanks to @alcaeus - - [535: Overhaul documentation](https://github.com/doctrine/DoctrineMongoDBBundle/pull/535) thanks to @malarzm - - [490: Update example for repository autowired](https://github.com/doctrine/DoctrineMongoDBBundle/pull/490) thanks to @j0k3r - - [531: Fix registration of the proxy autoloader](https://github.com/doctrine/DoctrineMongoDBBundle/pull/531) thanks to @alcaeus - - [524: Replace legacy Doctrine common code](https://github.com/doctrine/DoctrineMongoDBBundle/pull/524) thanks to @alanpoulain - - [502: Fix wrong capitalization of typeMap option](https://github.com/doctrine/DoctrineMongoDBBundle/pull/502) thanks to @alcaeus - - [489: Changed exception type](https://github.com/doctrine/DoctrineMongoDBBundle/pull/489) thanks to @blixit - - [488: CommandDataCollector ](https://github.com/doctrine/DoctrineMongoDBBundle/issues/488) thanks to @blixit - - [475: Prepare bundle for ODM 2.0](https://github.com/doctrine/DoctrineMongoDBBundle/pull/475) thanks to @alcaeus diff --git a/UPGRADE-3.5.md b/UPGRADE-3.5.md deleted file mode 100644 index eccd3d4e..00000000 --- a/UPGRADE-3.5.md +++ /dev/null @@ -1,5 +0,0 @@ -UPGRADE FROM 3.4 to 3.5 -======================= - -* The `default_repository_class` configuration was deprecated and will be - removed in 4.0. Use the `default_document_repository_class` option instead. diff --git a/UPGRADE-4.0.md b/UPGRADE-4.0.md deleted file mode 100644 index 60b5d563..00000000 --- a/UPGRADE-4.0.md +++ /dev/null @@ -1,15 +0,0 @@ -UPGRADE FROM 3.x to 4.0 -======================= - -* The bundle now requires MongoDB ODM 2.0. You should have a look at its UPGRADE - document and update your application accordingly. -* The `default_repository_class` configuration option was dropped. Use the - `default_document_repository_class` option instead. -* The `retry_connect` and `retry_query` configuration options were dropped - without replacement. -* The YAML metadata driver was dropped without replacement. -* The `doctrine:mongodb:generate:documents` and - `doctrine:mongodb:generate:repositories` commands have been dropped without - replacement. -* The `doctrine.odm.mongodb.document_manager` service was removed. Use the - `doctrine_mongodb.odm.document_manager` service instead. diff --git a/UPGRADE-4.4.md b/UPGRADE-4.4.md deleted file mode 100644 index a6f1f728..00000000 --- a/UPGRADE-4.4.md +++ /dev/null @@ -1,26 +0,0 @@ -UPGRADE FROM 4.0 to 4.4 -======================= - -* The `doctrine:mongodb:tail-cursor` command and - `Doctrine\Bundle\MongoDBBundle\Cursor\TailableCursorProcessorInterface` - interface have been deprecated. You should use - [change streams](https://docs.mongodb.com/manual/changeStreams/) instead. -* The `setContainer`, `getContainer`, `getDoctrineDocumentManagers`, - `findBundle` and `findBasePathForBundle` methods from - `Doctrine\Bundle\MongoDBBundle\Command\DoctrineODMCommand` have been - deprecated without replacement. -* The `Doctrine\Bundle\MongoDBBundle\Command\DoctrineODMCommand` class has - been marked as `@internal`, you should not extend from this class. -* The `doctrine_mongodb.odm.command_logger` service has been deprecated. You should use - `doctrine_mongodb.odm.psr_command_logger` instead. -* [BC Break] In order to have compatibility with Symfony 6, return types have - been added to the following methods: - * `Doctrine\Bundle\MongoDBBundle\DependencyInjection\DoctrineMongoDBExtension::getObjectManagerElementName()` - * `Doctrine\Bundle\MongoDBBundle\DependencyInjection\DoctrineMongoDBExtension::getMappingObjectDefaultName()` - * `Doctrine\Bundle\MongoDBBundle\DependencyInjection\DoctrineMongoDBExtension::getMappingResourceExtension()` - * `Doctrine\Bundle\MongoDBBundle\DependencyInjection\DoctrineMongoDBExtension::getAlias()` - * `Doctrine\Bundle\MongoDBBundle\DependencyInjection\DoctrineMongoDBExtension::loadCacheDriver()` - * `Doctrine\Bundle\MongoDBBundle\DoctrineMongoDBBundle::getContainerExtension()` - * `Doctrine\Bundle\MongoDBBundle\Form\ChoiceList\MongoDBQueryBuilderLoader::getEntities()` - * `Doctrine\Bundle\MongoDBBundle\Form\ChoiceList\MongoDBQueryBuilderLoader::getEntitiesByIds()` - * `Doctrine\Bundle\MongoDBBundle\Form\Type\DocumentType::getLoader()` diff --git a/UPGRADE-4.6.md b/UPGRADE-4.6.md deleted file mode 100644 index 870a57ae..00000000 --- a/UPGRADE-4.6.md +++ /dev/null @@ -1,7 +0,0 @@ -UPGRADE FROM 4.4 to 4.6 -======================= - -## PHP requirements - -* The bundle now requires PHP 7.4 or newer. If you're not running PHP 7.4 yet, - it's recommended that you upgrade to PHP 7.4 before upgrading the bundle. diff --git a/UPGRADE-4.7.md b/UPGRADE-4.7.md deleted file mode 100644 index b61cef99..00000000 --- a/UPGRADE-4.7.md +++ /dev/null @@ -1,13 +0,0 @@ -UPGRADE FROM 4.6 to 4.7 -======================= - -## PHP requirements - -* The bundle now requires PHP 8.1 or newer. If you're not running PHP 8.1 yet, - it's recommended that you upgrade to PHP 8.1 before upgrading the bundle. - -* The `fixture_loader` configuration option was deprecated and will be removed - in 5.0. -* The `doctrine_mongodb.odm.fixture_loader` parameter has been removed. -* Implementing `ContainerAwareInterface` on fixtures classes is deprecated, - use dependency injection instead. From 3a9b9d345a2743ff31b2127913c6a6d7efafcc6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Tue, 12 Dec 2023 10:57:23 +0100 Subject: [PATCH 2/3] Remove dependency to jean85/pretty-package-versions --- DependencyInjection/DoctrineMongoDBExtension.php | 4 ++-- composer.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DependencyInjection/DoctrineMongoDBExtension.php b/DependencyInjection/DoctrineMongoDBExtension.php index 4d948580..73ad48a2 100644 --- a/DependencyInjection/DoctrineMongoDBExtension.php +++ b/DependencyInjection/DoctrineMongoDBExtension.php @@ -4,6 +4,7 @@ namespace Doctrine\Bundle\MongoDBBundle\DependencyInjection; +use Composer\InstalledVersions; use Doctrine\Bundle\MongoDBBundle\Attribute\AsDocumentListener; use Doctrine\Bundle\MongoDBBundle\Attribute\MapDocument; use Doctrine\Bundle\MongoDBBundle\Command\LoadDataFixturesDoctrineODMCommand; @@ -18,7 +19,6 @@ use Doctrine\Common\EventSubscriber; use Doctrine\ODM\MongoDB\DocumentManager; use InvalidArgumentException; -use Jean85\PrettyVersions; use Symfony\Bridge\Doctrine\ArgumentResolver\EntityValueResolver; use Symfony\Bridge\Doctrine\DependencyInjection\AbstractDoctrineExtension; use Symfony\Bridge\Doctrine\Messenger\DoctrineClearEntityManagerWorkerSubscriber; @@ -653,7 +653,7 @@ private static function getODMVersion(): string { if (self::$odmVersion === null) { try { - self::$odmVersion = PrettyVersions::getVersion('doctrine/mongodb-odm')->getPrettyVersion(); + self::$odmVersion = InstalledVersions::getPrettyVersion('doctrine/mongodb-odm') ?? 'no version'; } catch (Throwable) { return 'unknown'; } diff --git a/composer.json b/composer.json index 59652ded..c1a4eead 100644 --- a/composer.json +++ b/composer.json @@ -26,9 +26,9 @@ "require": { "php": "^8.1", "ext-mongodb": "^1.5", + "composer-runtime-api": "^2.0", "doctrine/mongodb-odm": "^2.3", "doctrine/persistence": "^2.2 || ^3.0", - "jean85/pretty-package-versions": "^1.3.0 || ^2.0.1", "psr/log": "^1.0 || ^2.0 || ^3.0", "symfony/config": "^5.4 || ^6.2", "symfony/console": "^5.4 || ^6.2", From e8930307beeee1fb5a18130e59c13f9bddb395d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Tue, 12 Dec 2023 14:58:11 +0100 Subject: [PATCH 3/3] Remove legacy config "fixture_loader" (#808) --- DependencyInjection/Configuration.php | 7 ------- Tests/DependencyInjection/ConfigurationTest.php | 16 ---------------- Tests/Form/Type/GuesserTestType.php | 5 +++-- Tests/Form/Type/TypeGuesserTest.php | 1 - UPGRADE-5.0.md | 1 + 5 files changed, 4 insertions(+), 26 deletions(-) diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 0599c47e..9f03237c 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -76,13 +76,6 @@ public function getConfigTreeBuilder(): TreeBuilder ->scalarNode('persistent_collection_namespace')->defaultValue('PersistentCollections')->end() ->scalarNode('persistent_collection_dir')->defaultValue('%kernel.cache_dir%/doctrine/odm/mongodb/PersistentCollections')->end() ->scalarNode('auto_generate_persistent_collection_classes')->defaultValue(ODMConfiguration::AUTOGENERATE_NEVER)->end() - ->scalarNode('fixture_loader') - ->setDeprecated( - 'doctrine/mongodb-odm-bundle', - '4.7', - 'The "fixture_loader" option is deprecated and will be dropped in doctrine/mongodb-odm-bundle 5.0.', - ) - ->end() ->scalarNode('default_document_manager')->end() ->scalarNode('default_connection')->end() ->scalarNode('default_database')->defaultValue('default')->end() diff --git a/Tests/DependencyInjection/ConfigurationTest.php b/Tests/DependencyInjection/ConfigurationTest.php index 91dee4d5..3c041d74 100644 --- a/Tests/DependencyInjection/ConfigurationTest.php +++ b/Tests/DependencyInjection/ConfigurationTest.php @@ -5,7 +5,6 @@ namespace Doctrine\Bundle\MongoDBBundle\Tests\DependencyInjection; use Doctrine\Bundle\MongoDBBundle\DependencyInjection\Configuration; -use Doctrine\Bundle\MongoDBBundle\Loader\SymfonyFixturesLoader; use Doctrine\Bundle\MongoDBBundle\Tests\Fixtures\Filter\BasicFilter; use Doctrine\Bundle\MongoDBBundle\Tests\Fixtures\Filter\ComplexFilter; use Doctrine\Bundle\MongoDBBundle\Tests\Fixtures\Filter\DisabledFilter; @@ -512,19 +511,4 @@ public function testNullReplicaSetValue(): void $processedConfig = $processor->processConfiguration($configuration, [$config]); $this->assertFalse(array_key_exists('replicaSet', $processedConfig['connections']['conn1']['options'])); } - - /** @group legacy */ - public function testFixtureLoaderDeprecated(): void - { - $config = [ - 'fixture_loader' => SymfonyFixturesLoader::class, - ]; - - $processor = new Processor(); - $configuration = new Configuration(); - - $this->expectDeprecation('Since doctrine/mongodb-odm-bundle 4.7: The "fixture_loader" option is deprecated and will be dropped in doctrine/mongodb-odm-bundle 5.0.'); - - $processor->processConfiguration($configuration, [$config]); - } } diff --git a/Tests/Form/Type/GuesserTestType.php b/Tests/Form/Type/GuesserTestType.php index d0746a55..cf368b72 100644 --- a/Tests/Form/Type/GuesserTestType.php +++ b/Tests/Form/Type/GuesserTestType.php @@ -15,8 +15,9 @@ public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('name') - ->add('date') - ->add('ts') + // Not setting "date_widget" is deprecated in Symfony 6.4 + ->add('date', null, ['date_widget' => 'single_text']) + ->add('ts', null, ['date_widget' => 'single_text']) ->add('categories', null, ['document_manager' => $options['dm']]) ->add('boolField') ->add('floatField') diff --git a/Tests/Form/Type/TypeGuesserTest.php b/Tests/Form/Type/TypeGuesserTest.php index 8b407dd4..6c2261cf 100644 --- a/Tests/Form/Type/TypeGuesserTest.php +++ b/Tests/Form/Type/TypeGuesserTest.php @@ -50,7 +50,6 @@ protected function tearDown(): void parent::tearDown(); } - /** @group legacy */ public function testTypesShouldBeGuessedCorrectly(): void { $form = $this->factory->create(GuesserTestType::class, null, ['dm' => $this->dm]); diff --git a/UPGRADE-5.0.md b/UPGRADE-5.0.md index 8657add2..820c1d72 100644 --- a/UPGRADE-5.0.md +++ b/UPGRADE-5.0.md @@ -15,3 +15,4 @@ UPGRADE FROM 4.x to 5.0 * Remove `--service` option from `doctrine:mongodb:fixtures:load` command * Remove automatic injection of the container in fixtures classes implementing `ContainerAwareInterface`. You should use dependency injection instead. +* Remove the `fixture_loader` configuration