Skip to content

Commit 49e2028

Browse files
committed
[FrameworkBundle] also deprecate the internal rate limiter factory alias
1 parent 86c4522 commit 49e2028

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

DependencyInjection/FrameworkExtension.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
use Symfony\Component\DependencyInjection\Alias;
6262
use Symfony\Component\DependencyInjection\Argument\IteratorArgument;
6363
use Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgument;
64+
use Symfony\Component\DependencyInjection\Attribute\Target;
6465
use Symfony\Component\DependencyInjection\ChildDefinition;
6566
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
6667
use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass;
@@ -3301,7 +3302,12 @@ private function registerRateLimiterConfiguration(array $config, ContainerBuilde
33013302

33023303
if (interface_exists(RateLimiterFactoryInterface::class)) {
33033304
$container->registerAliasForArgument($limiterId, RateLimiterFactoryInterface::class, $name.'.limiter');
3304-
$factoryAlias->setDeprecated('symfony/dependency-injection', '7.3', 'The "%alias_id%" autowiring alias is deprecated and will be removed in 8.0, use "RateLimiterFactoryInterface" instead.');
3305+
$factoryAlias->setDeprecated('symfony/dependency-injection', '7.3', \sprintf('The "%%alias_id%%" autowiring alias is deprecated and will be removed in 8.0, use "%s $%s" instead.', RateLimiterFactoryInterface::class, (new Target($name.'.limiter'))->getParsedName()));
3306+
$internalAliasId = \sprintf('.%s $%s.limiter', RateLimiterFactory::class, $name);
3307+
3308+
if ($container->hasAlias($internalAliasId)) {
3309+
$container->getAlias($internalAliasId)->setDeprecated('symfony/framework-bundle', '7.3', \sprintf('The "%%alias_id%%" autowiring alias is deprecated and will be removed in 8.0, use "%s $%s" instead.', RateLimiterFactoryInterface::class, (new Target($name.'.limiter'))->getParsedName()));
3310+
}
33053311
}
33063312
}
33073313

0 commit comments

Comments
 (0)