File tree 5 files changed +38
-2
lines changed
5 files changed +38
-2
lines changed Original file line number Diff line number Diff line change 1
1
CHANGELOG
2
2
=========
3
3
4
+ 7.3
5
+ ---
6
+
7
+ * Add ` RateLimiterFactoryInterface ` as an alias of the ` limiter ` service
8
+
4
9
7.2
5
10
---
6
11
Original file line number Diff line number Diff line change 12
12
namespace Symfony \Component \DependencyInjection \Loader \Configurator ;
13
13
14
14
use Symfony \Component \RateLimiter \RateLimiterFactory ;
15
+ use Symfony \Component \RateLimiter \RateLimiterFactoryInterface ;
15
16
16
17
return static function (ContainerConfigurator $ container ) {
17
18
$ container ->services ()
26
27
abstract_arg ('storage ' ),
27
28
null ,
28
29
])
30
+
31
+ ->alias (RateLimiterFactoryInterface::class, 'limiter ' )
29
32
;
30
33
};
Original file line number Diff line number Diff line change 1
1
CHANGELOG
2
2
=========
3
3
4
+ 7.3
5
+ ---
6
+
7
+ * Add ` RateLimiterFactoryInterface `
8
+
4
9
6.4
5
10
---
6
11
Original file line number Diff line number Diff line change 24
24
/**
25
25
* @author Wouter de Jong <wouter@wouterj.nl>
26
26
*/
27
- final class RateLimiterFactory
27
+ final class RateLimiterFactory implements RateLimiterFactoryInterface
28
28
{
29
29
private array $ config ;
30
30
@@ -53,7 +53,7 @@ public function create(?string $key = null): LimiterInterface
53
53
};
54
54
}
55
55
56
- protected static function configureOptions (OptionsResolver $ options ): void
56
+ private static function configureOptions (OptionsResolver $ options ): void
57
57
{
58
58
$ intervalNormalizer = static function (Options $ options , string $ interval ): \DateInterval {
59
59
// Create DateTimeImmutable from unix timesatmp, so the default timezone is ignored and we don't need to
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of the Symfony package.
5
+ *
6
+ * (c) Fabien Potencier <fabien@symfony.com>
7
+ *
8
+ * For the full copyright and license information, please view the LICENSE
9
+ * file that was distributed with this source code.
10
+ */
11
+
12
+ namespace Symfony \Component \RateLimiter ;
13
+
14
+ /**
15
+ * @author Alexandre Daubois <alex.daubois@gmail.com>
16
+ */
17
+ interface RateLimiterFactoryInterface
18
+ {
19
+ /**
20
+ * @param string|null $key An optional key used to identify the limiter.
21
+ */
22
+ public function create (?string $ key = null ): LimiterInterface ;
23
+ }
You can’t perform that action at this time.
0 commit comments