diff --git a/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md b/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md index 17201aeaec284..3e10d305f2e6a 100644 --- a/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md +++ b/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md @@ -9,7 +9,7 @@ CHANGELOG * Add JsonStreamer services and configuration * Add new `framework.property_info.with_constructor_extractor` option to allow enabling or disabling the constructor extractor integration * Deprecate the `--show-arguments` option of the `container:debug` command, as arguments are now always shown - * Add `RateLimiterFactoryInterface` as an alias of the `limiter` service + * Add autowiring alias for `RateLimiterFactoryInterface` * Add `framework.validation.disable_translation` option * Add support for signal plain name in the `messenger.stop_worker_on_signals` configuration * Deprecate the `framework.validation.cache` option diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index 418ee739c6863..49078e2ee70e3 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -151,6 +151,7 @@ use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface; use Symfony\Component\RateLimiter\LimiterInterface; use Symfony\Component\RateLimiter\RateLimiterFactory; +use Symfony\Component\RateLimiter\RateLimiterFactoryInterface; use Symfony\Component\RateLimiter\Storage\CacheStorage; use Symfony\Component\RemoteEvent\Attribute\AsRemoteEventConsumer; use Symfony\Component\RemoteEvent\RemoteEvent; @@ -3201,6 +3202,10 @@ private function registerRateLimiterConfiguration(array $config, ContainerBuilde $limiter->replaceArgument(0, $limiterConfig); $container->registerAliasForArgument($limiterId, RateLimiterFactory::class, $name.'.limiter'); + + if (interface_exists(RateLimiterFactoryInterface::class)) { + $container->registerAliasForArgument($limiterId, RateLimiterFactoryInterface::class, $name.'.limiter'); + } } } diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/rate_limiter.php b/src/Symfony/Bundle/FrameworkBundle/Resources/config/rate_limiter.php index 90af4d7588f1d..727a1f6364456 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/rate_limiter.php +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/rate_limiter.php @@ -12,7 +12,6 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator; use Symfony\Component\RateLimiter\RateLimiterFactory; -use Symfony\Component\RateLimiter\RateLimiterFactoryInterface; return static function (ContainerConfigurator $container) { $container->services() @@ -28,9 +27,4 @@ null, ]) ; - - if (interface_exists(RateLimiterFactoryInterface::class)) { - $container->services() - ->alias(RateLimiterFactoryInterface::class, 'limiter'); - } };