10000 [RateLimiter] Add `RateLimitFactoryInterface` · symfony/symfony@ecd611c · GitHub
[go: up one dir, main page]

Skip to content

Commit ecd611c

Browse files
author
Nathan Salter
committed
[RateLimiter] Add RateLimitFactoryInterface
Adds an interface for the `RateLimitFactory` to allow alternative integrations or use in unit tests. See Issue #46644
1 parent f1c9c60 commit ecd611c

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

src/Symfony/Component/RateLimiter/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
CHANGELOG
22
=========
3+
6.1
4+
---
5+
* Switch to use an Interface for the `RateLimiterFactory`
36

47
5.4
58
---

src/Symfony/Component/RateLimiter/RateLimiterFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
/**
2626
* @author Wouter de Jong <wouter@wouterj.nl>
2727
*/
28-
final class RateLimiterFactory
28+
final class RateLimiterFactory implements RateLimiterFactoryInterface
2929
{
3030
private array $config;
3131
private StorageInterface $storage;
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
interface RateLimiterFactoryInterface
15+
{
16+
public function create(string $key = null): LimiterInterface;
17+
}

0 commit comments

Comments
 (0)
0