Skip to content

Commit 9fb2ba2

Browse files
committed
bug #59930 [FrameworkBundle] fix autowiring RateLimiterFactoryInterface (kbond)
This PR was merged into the 7.3 branch. Discussion ---------- [FrameworkBundle] fix autowiring `RateLimiterFactoryInterface` | Q | A | ------------- | --- | Branch? | 7.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix bug in #58939 | License | MIT Fixes a small bug from #58939. Confirmed with `@alexandre`-daubois this was the intention. Commits ------- 7130a9f [FrameworkBundle] fix autowiring `RateLimiterFactoryInterface`
2 parents 6a029ec + 7130a9f commit 9fb2ba2

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ CHANGELOG
99
* Add JsonStreamer services and configuration
1010
* Add new `framework.property_info.with_constructor_extractor` option to allow enabling or disabling the constructor extractor integration
1111
* Deprecate the `--show-arguments` option of the `container:debug` command, as arguments are now always shown
12-
* Add `RateLimiterFactoryInterface` as an alias of the `limiter` service
12+
* Add autowiring alias for `RateLimiterFactoryInterface`
1313
* Add `framework.validation.disable_translation` option
1414
* Add support for signal plain name in the `messenger.stop_worker_on_signals` configuration
1515
* Deprecate the `framework.validation.cache` option

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

+5
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@
151151
use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface;
152152
use Symfony\Component\RateLimiter\LimiterInterface;
153153
use Symfony\Component\RateLimiter\RateLimiterFactory;
154+
use Symfony\Component\RateLimiter\RateLimiterFactoryInterface;
154155
use Symfony\Component\RateLimiter\Storage\CacheStorage;
155156
use Symfony\Component\RemoteEvent\Attribute\AsRemoteEventConsumer;
156157
use Symfony\Component\RemoteEvent\RemoteEvent;
@@ -3201,6 +3202,10 @@ private function registerRateLimiterConfiguration(array $config, ContainerBuilde
32013202
$limiter->replaceArgument(0, $limiterConfig);
32023203

32033204
$container->registerAliasForArgument($limiterId, RateLimiterFactory::class, $name.'.limiter');
3205+
3206+
if (interface_exists(RateLimiterFactoryInterface::class)) {
3207+
$container->registerAliasForArgument($limiterId, RateLimiterFactoryInterface::class, $name.'.limiter');
3208+
}
32043209
}
32053210
}
32063211

src/Symfony/Bundle/FrameworkBundle/Resources/config/rate_limiter.php

-6
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
1313

1414
use Symfony\Component\RateLimiter\RateLimiterFactory;
15-
use Symfony\Component\RateLimiter\RateLimiterFactoryInterface;
1615

1716
return static function (ContainerConfigurator $container) {
1817
$container->services()
@@ -28,9 +27,4 @@
2827
null,
2928
])
3029
;
31-
32-
if (interface_exists(RateLimiterFactoryInterface::class)) {
33-
$container->services()
34-
->alias(RateLimiterFactoryInterface::class, 'limiter');
35-
}
3630
};

0 commit comments

Comments
 (0)