File tree Expand file tree Collapse file tree 5 files changed +38
-2
lines changed
Expand file tree Collapse file tree 5 files changed +38
-2
lines changed Original file line number Diff line number Diff line change 11CHANGELOG
22=========
33
4+ 7.3
5+ ---
6+
7+ * Add ` RateLimiterFactoryInterface ` as an alias of the ` limiter ` service
8+
497.2
510---
611
Original file line number Diff line number Diff line change 1212namespace Symfony \Component \DependencyInjection \Loader \Configurator ;
1313
1414use Symfony \Component \RateLimiter \RateLimiterFactory ;
15+ use Symfony \Component \RateLimiter \RateLimiterFactoryInterface ;
1516
1617return static function (ContainerConfigurator $ container ) {
1718 $ container ->services ()
2627 abstract_arg ('storage ' ),
2728 null ,
2829 ])
30+
31+ ->alias (RateLimiterFactoryInterface::class, 'limiter ' )
2932 ;
3033};
Original file line number Diff line number Diff line change 11CHANGELOG
22=========
33
4+ 7.3
5+ ---
6+
7+ * Add ` RateLimiterFactoryInterface `
8+
496.4
510---
611
Original file line number Diff line number Diff line change 2424/**
2525 * @author Wouter de Jong <wouter@wouterj.nl>
2626 */
27- final class RateLimiterFactory
27+ final class RateLimiterFactory implements RateLimiterFactoryInterface
2828{
2929 private array $ config ;
3030
@@ -53,7 +53,7 @@ public function create(?string $key = null): LimiterInterface
5353 };
5454 }
5555
56- protected static function configureOptions (OptionsResolver $ options ): void
56+ private static function configureOptions (OptionsResolver $ options ): void
5757 {
5858 $ intervalNormalizer = static function (Options $ options , string $ interval ): \DateInterval {
5959 // 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