From e4b423df446894b858e55cb7efcb3251715a0f4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Tue, 19 Dec 2023 22:11:21 +0100 Subject: [PATCH] Remove deprecated configuration --- DependencyInjection/Configuration.php | 20 ------------------- Resources/config/schema/mongodb-1.0.xsd | 7 ------- .../DependencyInjection/ConfigurationTest.php | 10 ++-------- .../Fixtures/config/xml/full.xml | 3 --- .../Fixtures/config/yml/full.yml | 3 --- UPGRADE-5.0.md | 11 ++++++++++ 6 files changed, 13 insertions(+), 41 deletions(-) diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index b7c215da..92da7cea 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -86,13 +86,6 @@ public function getConfigTreeBuilder(): TreeBuilder ->integerNode('timeout')->end() ->scalarNode('w')->end() ->integerNode('wtimeout')->end() - // Deprecated options - ->booleanNode('fsync') - ->setDeprecated('doctrine/mongodb-odm-bundle', '4.7', 'Option "fsync" is deprecated. Use "j" option instead.') - ->end() - ->scalarNode('safe') - ->setDeprecated('doctrine/mongodb-odm-bundle', '4.7', 'Option "safe" is deprecated. Use "w" option instead.') - ->end() ->end() ->end() ->arrayNode('controller_resolver') @@ -316,19 +309,6 @@ private function addConnectionsSection(ArrayNodeDefinition $rootNode): void ->booleanNode('retryWrites')->end() ->scalarNode('w')->end() ->integerNode('wTimeoutMS')->end() - // Deprecated options - ->booleanNode('fsync') - ->setDeprecated('doctrine/mongodb-odm-bundle', '4.7', 'Option "fsync" is deprecated. Use "journal" option instead.') - ->end() - ->booleanNode('slaveOkay') - ->setDeprecated('doctrine/mongodb-odm-bundle', '4.7', 'Option "slaveOkay" is deprecated. Use "readPreference" option instead.') - ->end() - ->integerNode('timeout') - ->setDeprecated('doctrine/mongodb-odm-bundle', '4.7', 'Option "timeout" is deprecated. Use "connectTimeoutMS" option instead.') - ->end() - ->integerNode('wTimeout') - ->setDeprecated('doctrine/mongodb-odm-bundle', '4.7', 'Option "wTimeout" is deprecated. Use "wTimeoutMS" option instead.') - ->end() ->end() ->validate() ->ifTrue(static function ($v): bool { diff --git a/Resources/config/schema/mongodb-1.0.xsd b/Resources/config/schema/mongodb-1.0.xsd index 16daed56..4a63e8be 100644 --- a/Resources/config/schema/mongodb-1.0.xsd +++ b/Resources/config/schema/mongodb-1.0.xsd @@ -30,9 +30,7 @@ - - @@ -83,11 +81,6 @@ - - - - - diff --git a/Tests/DependencyInjection/ConfigurationTest.php b/Tests/DependencyInjection/ConfigurationTest.php index 1c33e639..5cbff3ad 100644 --- a/Tests/DependencyInjection/ConfigurationTest.php +++ b/Tests/DependencyInjection/ConfigurationTest.php @@ -58,10 +58,7 @@ public function testDefaults(): void $this->assertEquals($defaults, $options); } - /** - * @dataProvider provideFullConfiguration - * @group legacy - */ + /** @dataProvider provideFullConfiguration */ public function testFullConfiguration(array $config): void { $processor = new Processor(); @@ -86,8 +83,6 @@ public function testFullConfiguration(array $config): void 'timeout' => 10, 'w' => 'majority', 'wtimeout' => 10, - 'fsync' => false, - 'safe' => 2, ], 'connections' => [ 'conn1' => [ @@ -104,7 +99,6 @@ public function testFullConfiguration(array $config): void [], ], 'replicaSet' => 'foo', - 'slaveOkay' => true, 'socketTimeoutMS' => 1000, 'ssl' => true, 'tls' => true, @@ -279,7 +273,7 @@ public static function provideMergeOptions(): array // the "options" array is totally replaced $cases[] = [ [ - ['connections' => ['default' => ['options' => ['timeout' => 2000]]]], + ['connections' => ['default' => ['options' => ['socketTimeoutMS' => 2000]]]], ['connections' => ['default' => ['options' => ['username' => 'foo']]]], ], ['connections' => ['default' => ['options' => ['username' => 'foo']]]], diff --git a/Tests/DependencyInjection/Fixtures/config/xml/full.xml b/Tests/DependencyInjection/Fixtures/config/xml/full.xml index 893d4227..363038c3 100644 --- a/Tests/DependencyInjection/Fixtures/config/xml/full.xml +++ b/Tests/DependencyInjection/Fixtures/config/xml/full.xml @@ -26,8 +26,6 @@ timeout="10" w="majority" wtimeout="10" - fsync="false" - safe="2" /> @@ -39,7 +37,6 @@ password="password_val" readPreference="secondaryPreferred" replicaSet="foo" - slaveOkay="true" socketTimeoutMS="1000" ssl="true" tls="true" diff --git a/Tests/DependencyInjection/Fixtures/config/yml/full.yml b/Tests/DependencyInjection/Fixtures/config/yml/full.yml index d75ddc8b..5b3e8ef9 100644 --- a/Tests/DependencyInjection/Fixtures/config/yml/full.yml +++ b/Tests/DependencyInjection/Fixtures/config/yml/full.yml @@ -20,8 +20,6 @@ doctrine_mongodb: timeout: 10 w: majority wtimeout: 10 - fsync: false - safe: 2 connections: conn1: @@ -38,7 +36,6 @@ doctrine_mongodb: - { dc: west } - { } replicaSet: foo - slaveOkay: true socketTimeoutMS: 1000 ssl: true tls: true diff --git a/UPGRADE-5.0.md b/UPGRADE-5.0.md index 9b9c5aee..033fa602 100644 --- a/UPGRADE-5.0.md +++ b/UPGRADE-5.0.md @@ -18,6 +18,17 @@ UPGRADE FROM 4.x to 5.0 Remove all `doctrine_mongodb.odm.*` parameters. +Deprecated options have been removed: + +| namespace | removed | replaced by | +|--------------------------|-------------|--------------------| +| `default_commit_options` | `fsync` | `j` | +| `default_commit_options` | `safe` | `w` | +| `connections.*.options` | `fsync` | `journal` | +| `connections.*.options` | `slaveOkay` | `readPreference` | +| `connections.*.options` | `timeout` | `connectTimeoutMS` | +| `connections.*.options` | `wTimeout` | `wTimeoutMS` | + ## Fixtures * Remove `--service` option from `doctrine:mongodb:fixtures:load` command