Skip to content

Commit 7069df3

Browse files
committed
feature #38664 [RateLimiter] Moved classes implementing LimiterInterface to a new namespace (Nyholm)
This PR was squashed before being merged into the 5.2-dev branch. Discussion ---------- [RateLimiter] Moved classes implementing LimiterInterface to a new namespace | Q | A | ------------- | --- | Branch? | 5.x | Bug fix? | no | New feature? | no | Deprecations? | no? | Tickets | | License | MIT | Doc PR | Before we release the RateLimit component. I think it would be a good idea to put the 7 classes that belongs to a specific strategy in their own "Policy" namespace. It is very likely that it will be more strategies in the future and the `Symfony\Component\RateLimiter` namespace is crowed as it is. I decided not to put the `CompoundLimiter` in this namespace as it is not a strategy. Commits ------- 1e6cea56e4 [RateLimiter] Moved classes implementing LimiterInterface to a new namespace
2 parents 66259c8 + 411c17c commit 7069df3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

DependencyInjection/Configuration.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
use Symfony\Component\Messenger\MessageBusInterface;
3232
use Symfony\Component\Notifier\Notifier;
3333
use Symfony\Component\PropertyInfo\PropertyInfoExtractorInterface;
34-
use Symfony\Component\RateLimiter\TokenBucketLimiter;
34+
use Symfony\Component\RateLimiter\Policy\TokenBucketLimiter;
3535
use Symfony\Component\Serializer\Serializer;
3636
use Symfony\Component\Translation\Translator;
3737
use Symfony\Component\Validator\Validation;
@@ -1843,7 +1843,7 @@ private function addRateLimiterSection(ArrayNodeDefinition $rootNode)
18431843
->info('The service ID of a custom storage implementation, this precedes any configured "cache_pool"')
18441844
->defaultNull()
18451845
->end()
1846-
->enumNode('strategy')
1846+
->enumNode('policy')
18471847
->info('The rate limiting algorithm to use for this rate')
18481848
->isRequired()
18491849
->values(['fixed_window', 'token_bucket', 'sliding_window', 'no_limit'])
@@ -1853,10 +1853,10 @@ private function addRateLimiterSection(ArrayNodeDefinition $rootNode)
18531853
->isRequired()
18541854
->end()
18551855
->scalarNode('interval')
1856-
->info('Configures the fixed interval if "strategy" is set to "fixed_window" or "sliding_window". The value must be a number followed by "second", "minute", "hour", "day", "week" or "month" (or their plural equivalent).')
1856+
->info('Configures the fixed interval if "policy" is set to "fixed_window" or "sliding_window". The value must be a number followed by "second", "minute", "hour", "day", "week" or "month" (or their plural equivalent).')
18571857
->end()
18581858
->arrayNode('rate')
1859-
->info('Configures the fill rate if "strategy" is set to "token_bucket"')
1859+
->info('Configures the fill rate if "policy" is set to "token_bucket"')
18601860
->children()
18611861
->scalarNode('interval')
18621862
->info('Configures the rate interval. The value must be a number followed by "second", "minute", "hour", "day", "week" or "month" (or their plural equivalent).')

0 commit comments

Comments
 (0)