Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5c73e8d

Browse files
feature #41284 [Lock] Remove deprecated classes in Lock (jderusse)
This PR was merged into the 6.0 branch. Discussion ---------- [Lock] Remove deprecated classes in Lock | Q | A | ------------- | --- | Branch? | 6.0 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | / | License | MIT | Doc PR | / Remove deprecated paths in `Lock` component Commits ------- 0a7497e Remove deprecated classes in Lock
2 parents f299644 + 0a7497e commit 5c73e8d

File tree

7 files changed

+12
-183
lines changed

7 files changed

+12
-183
lines changed

src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
6.0
5+
---
6+
7+
* Remove the `lock.RESOURCE_NAME` and `lock.RESOURCE_NAME.store` services and the `lock`, `LockInterface`, `lock.store` and `PersistingStoreInterface` aliases, use `lock.RESOURCE_NAME.factory`, `lock.factory` or `LockFactory` instead
8+
49
5.4
510
---
611

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@
8181
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
8282
use Symfony\Component\Lock\Lock;
8383
use Symfony\Component\Lock\LockFactory;
84-
use Symfony\Component\Lock\LockInterface;
8584
use Symfony\Component\Lock\PersistingStoreInterface;
8685
use Symfony\Component\Lock\Store\StoreFactory;
8786
use Symfony\Component\Lock\StoreInterface;
@@ -1836,10 +1835,7 @@ private function registerLockConfiguration(array $config, ContainerBuilder $cont
18361835
if (\count($storeDefinitions) > 1) {
18371836
$combinedDefinition = new ChildDefinition('lock.store.combined.abstract');
18381837
$combinedDefinition->replaceArgument(0, $storeDefinitions);
1839-
$container->setDefinition('lock.'.$resourceName.'.store', $combinedDefinition)->setDeprecated('symfony/framework-bundle', '5.2', 'The "%service_id%" service is deprecated, use "lock.'.$resourceName.'.factory" instead.');
18401838
$container->setDefinition($storeDefinitionId = '.lock.'.$resourceName.'.store.'.$container->hash($resourceStores), $combinedDefinition);
1841-
} else {
1842-
$container->setAlias('lock.'.$resourceName.'.store', (new Alias($storeDefinitionId, false))->setDeprecated('symfony/framework-bundle', '5.2', 'The "%alias_id%" alias is deprecated, use "lock.'.$resourceName.'.factory" instead.'));
18431839
}
18441840

18451841
// Generate factories for each resource
@@ -1852,20 +1848,13 @@ private function registerLockConfiguration(array $config, ContainerBuilder $cont
18521848
$lockDefinition->setPublic(false);
18531849
$lockDefinition->setFactory([new Reference('lock.'.$resourceName.'.factory'), 'createLock']);
18541850
$lockDefinition->setArguments([$resourceName]);
1855-
$container->setDefinition('lock.'.$resourceName, $lockDefinition)->setDeprecated('symfony/framework-bundle', '5.2', 'The "%service_id%" service is deprecated, use "lock.'.$resourceName.'.factory" instead.');
18561851

18571852
// provide alias for default resource
18581853
if ('default' === $resourceName) {
1859-
$container->setAlias('lock.store', (new Alias($storeDefinitionId, false))->setDeprecated('symfony/framework-bundle', '5.2', 'The "%alias_id%" alias is deprecated, use "lock.factory" instead.'));
18601854
$container->setAlias('lock.factory', new Alias('lock.'.$resourceName.'.factory', false));
1861-
$container->setAlias('lock', (new Alias('lock.'.$resourceName, false))->setDeprecated('symfony/framework-bundle', '5.2', 'The "%alias_id%" alias is deprecated, use "lock.factory" instead.'));
1862-
$container->setAlias(PersistingStoreInterface::class, (new Alias($storeDefinitionId, false))->setDeprecated('symfony/framework-bundle', '5.2', 'The "%alias_id%" alias is deprecated, use "'.LockFactory::class.'" instead.'));
18631855
$container->setAlias(LockFactory::class, new Alias('lock.factory', false));
1864-
$container->setAlias(LockInterface::class, (new Alias('lock.'.$resourceName, false))->setDeprecated('symfony/framework-bundle', '5.2', 'The "%alias_id%" alias is deprecated, use "'.LockFactory::class.'" instead.'));
18651856
} else {
1866-
$container->registerAliasForArgument($storeDefinitionId, PersistingStoreInterface::class, $resourceName.'.lock.store')->setDeprecated('symfony/framework-bundle', '5.2', 'The "%alias_id%" alias is deprecated, use "'.LockFactory::class.' '.$resourceName.'LockFactory" instead.');
18671857
$container->registerAliasForArgument('lock.'.$resourceName.'.factory', LockFactory::class, $resourceName.'.lock.factory');
1868-
$container->registerAliasForArgument('lock.'.$resourceName, LockInterface::class, $resourceName.'.lock')->setDeprecated('symfony/framework-bundle', '5.2', 'The "%alias_id%" alias is deprecated, use "'.LockFactory::class.' $'.$resourceName.'LockFactory" instead.');
18691858
}
18701859
}
18711860
}

src/Symfony/Component/Lock/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
CHANGELOG
22
=========
33

4+
6.0
5+
---
6+
7+
* Remove the `NotSupportedException`. It shouldn't be thrown anymore
8+
* Remove the `RetryTillSaveStore`. Logic has been moved in `Lock` and is not needed anymore
9+
410
5.2.0
511
-----
612

src/Symfony/Component/Lock/Exception/NotSupportedException.php

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/Symfony/Component/Lock/Store/RetryTillSaveStore.php

Lines changed: 0 additions & 107 deletions
This file was deleted.

src/Symfony/Component/Lock/Tests/Store/RetryTillSaveStoreTest.php

Lines changed: 0 additions & 38 deletions
This file was deleted.

src/Symfony/Component/Lock/composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
],
1818
"require": {
1919
"php": ">=8.0.2",
20-
"psr/log": "~1.0",
21-
"symfony/deprecation-contracts": "^2.1"
20+
"psr/log": "~1.0"
2221
},
2322
"require-dev": {
2423
"doctrine/dbal": "^2.10|^3.0",

0 commit comments

Comments
 (0)