Skip to content

Commit c608e1d

Browse files
wouterjfabpot
authored andcommitted
[RateLimiter] Added reserve() to LimiterInterface and rename Limiter to RateLimiter
1 parent 7f3d79a commit c608e1d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

RateLimiter/DefaultLoginRateLimiter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
use Symfony\Component\HttpFoundation\RateLimiter\AbstractRequestRateLimiter;
1515
use Symfony\Component\HttpFoundation\Request;
16-
use Symfony\Component\RateLimiter\Limiter;
16+
use Symfony\Component\RateLimiter\RateLimiter;
1717
use Symfony\Component\Security\Core\Security;
1818

1919
/**
@@ -31,7 +31,7 @@ final class DefaultLoginRateLimiter extends AbstractRequestRateLimiter
3131
private $globalLimiter;
3232
private $localLimiter;
3333

34-
public function __construct(Limiter $globalLimiter, Limiter $localLimiter)
34+
public function __construct(RateLimiter $globalLimiter, RateLimiter $localLimiter)
3535
{
3636
$this->globalLimiter = $globalLimiter;
3737
$this->localLimiter = $localLimiter;

Tests/EventListener/LoginThrottlingListenerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\Component\HttpFoundation\Request;
1616
use Symfony\Component\HttpFoundation\RequestStack;
17-
use Symfony\Component\RateLimiter\Limiter;
17+
use Symfony\Component\RateLimiter\RateLimiter;
1818
use Symfony\Component\RateLimiter\Storage\InMemoryStorage;
1919
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
2020
use Symfony\Component\Security\Core\Exception\TooManyLoginAttemptsAuthenticationException;
@@ -35,13 +35,13 @@ protected function setUp(): void
3535
{
3636
$this->requestStack = new RequestStack();
3737

38-
$localLimiter = new Limiter([
38+
$localLimiter = new RateLimiter([
3939
'id' => 'login',
4040
'strategy' => 'fixed_window',
4141
'limit' => 3,
4242
'interval' => '1 minute',
4343
], new InMemoryStorage());
44-
$globalLimiter = new Limiter([
44+
$globalLimiter = new RateLimiter([
4545
'id' => 'login',
4646
'strategy' => 'fixed_window',
4747
'limit' => 6,

0 commit comments

Comments
 (0)