Skip to content

Commit 5dd87d2

Browse files
committed
bug #60322 [FrameworkBundle] drop the limiters option for non-compound rater limiters (xabbuh)
This PR was merged into the 7.3 branch. Discussion ---------- [FrameworkBundle] drop the limiters option for non-compound rater limiters | Q | A | ------------- | --- | Branch? | 7.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #60306 | License | MIT Commits ------- 406e68a drop the limiters option for non-compound rater limiters
2 parents 6e4d251 + 406e68a commit 5dd87d2

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3255,6 +3255,8 @@ private function registerRateLimiterConfiguration(array $config, ContainerBuilde
32553255
continue;
32563256
}
32573257

3258+
unset($limiterConfig['limiters']);
3259+
32583260
$limiters[] = $name;
32593261

32603262
// default configuration (when used by other DI extensions)

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/PhpFrameworkExtensionTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,19 @@ public function testRateLimiterCompoundPolicy()
314314
]);
315315
});
316316

317+
$this->assertSame([
318+
'policy' => 'fixed_window',
319+
'limit' => 10,
320+
'interval' => '1 hour',
321+
'id' => 'first',
322+
], $container->getDefinition('limiter.first')->getArgument(0));
323+
$this->assertSame([
324+
'policy' => 'sliding_window',
325+
'limit' => 10,
326+
'interval' => '1 hour',
327+
'id' => 'second',
328+
], $container->getDefinition('limiter.second')->getArgument(0));
329+
317330
$definition = $container->getDefinition('limiter.compound');
318331
$this->assertSame(CompoundRateLimiterFactory::class, $definition->getClass());
319332
$this->assertEquals(

0 commit comments

Comments
 (0)