Skip to content

[FrameworkBundle] fix autowiring RateLimiterFactoryInterface #59930

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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');
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -28,9 +27,4 @@
null,
])
;

if (interface_exists(RateLimiterFactoryInterface::class)) {
$container->services()
->alias(RateLimiterFactoryInterface::class, 'limiter');
}
};
Loading