8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
RateLimiterFactoryInterface
1 parent bec056a commit 2bd3a61Copy full SHA for 2bd3a61
src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md
@@ -1,6 +1,11 @@
1
CHANGELOG
2
=========
3
4
+7.3
5
+---
6
+
7
+ * Add `RateLimiterFactoryInterface` as an alias of the `limiter` service
8
9
7.2
10
---
11
src/Symfony/Bundle/FrameworkBundle/Resources/config/rate_limiter.php
@@ -12,6 +12,7 @@
12
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
13
14
use Symfony\Component 8000 \RateLimiter\RateLimiterFactory;
15
+use Symfony\Component\RateLimiter\RateLimiterFactoryInterface;
16
17
return static function (ContainerConfigurator $container) {
18
$container->services()
@@ -26,5 +27,7 @@
26
27
abstract_arg('storage'),
28
null,
29
])
30
31
+ ->alias(RateLimiterFactoryInterface::class, 'limiter')
32
;
33
};
src/Symfony/Component/RateLimiter/CHANGELOG.md
+ * Add `RateLimiterFactoryInterface`
6.4
src/Symfony/Component/RateLimiter/RateLimiterFactory.php
@@ -24,7 +24,7 @@
24
/**
25
* @author Wouter de Jong <wouter@wouterj.nl>
*/
-final class RateLimiterFactory
+final class RateLimiterFactory implements RateLimiterFactoryInterface
{
private array $config;
@@ -53,7 +53,7 @@ public function create(?string $key = null): LimiterInterface
53
54
}
55
56
- protected static function configureOptions(OptionsResolver $options): void
+ private static function configureOptions(OptionsResolver $options): void
57
58
$intervalNormalizer = static function (Options $options, string $interval): \DateInterval {
59
// Create DateTimeImmutable from unix timesatmp, so the default timezone is ignored and we don't need to
src/Symfony/Component/RateLimiter/RateLimiterFactoryInterface.php
@@ -0,0 +1,23 @@
+<?php
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace Symfony\Component\RateLimiter;
+/**
+ * @author Alexandre Daubois <alex.daubois@gmail.com>
+interface RateLimiterFactoryInterface
+{
19
+ /**
20
+ * @param string|null $key An optional key used to identify the limiter.
21
22
+ public function create(?string $key = null): LimiterInterface;
23
+}