Skip to content

Commit e4dba8a

Browse files
committed
Remove deprecated classes in Lock
1 parent 1cec4a5 commit e4dba8a

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.3
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;
@@ -1838,10 +1837,7 @@ private function registerLockConfiguration(array $config, ContainerBuilder $cont
18381837
if (\count($storeDefinitions) > 1) {
18391838
$combinedDefinition = new ChildDefinition('lock.store.combined.abstract');
18401839
$combinedDefinition->replaceArgument(0, $storeDefinitions);
1841-
$container->setDefinition('lock.'.$resourceName.'.store', $combinedDefinition)->setDeprecated('symfony/framework-bundle', '5.2', 'The "%service_id%" service is deprecated, use "lock.'.$resourceName.'.factory" instead.');
18421840
$container->setDefinition($storeDefinitionId = '.lock.'.$resourceName.'.store.'.$container->hash($resourceStores), $combinedDefinition);
1843-
} else {
1844-
$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.'));
18451841
}
18461842

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

18591854
// provide alias for default resource
18601855
if ('default' === $resourceName) {
1861-
$container->setAlias('lock.store', (new Alias($storeDefinitionId, false))->setDeprecated('symfony/framework-bundle', '5.2', 'The "%alias_id%" alias is deprecated, use "lock.factory" instead.'));
18621856
$container->setAlias('lock.factory', new Alias('lock.'.$resourceName.'.factory', false));
1863-
$container->setAlias('lock', (new Alias('lock.'.$resourceName, false))->setDeprecated('symfony/framework-bundle', '5.2', 'The "%alias_id%" alias is deprecated, use "lock.factory" instead.'));
1864-
$container->setAlias(PersistingStoreInterface::class, (new Alias($storeDefinitionId, false))->setDeprecated('symfony/framework-bundle', '5.2', 'The "%alias_id%" alias is deprecated, use "'.LockFactory::class.'" instead.'));
18651857
$container->setAlias(LockFactory::class, new Alias('lock.factory', false));
1866-
$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.'));
18671858
} else {
1868-
$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.');
18691859
$container->registerAliasForArgument('lock.'.$resourceName.'.factory', LockFactory::class, $resourceName.'.lock.factory');
1870-
$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.');
18711860
}
18721861
}
18731862
}

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)