1 | <?php |
||
9 | final class InMemoryRateLimiter implements RateLimiter, SilentRateLimiter |
||
10 | { |
||
11 | /** @var array */ |
||
12 | private $store = []; |
||
13 | |||
14 | 2 | public function limit(string $identifier, Rate $rate): void |
|
24 | |||
25 | 3 | public function limitSilently(string $identifier, Rate $rate): Status |
|
38 | |||
39 | 5 | private function key(string $identifier, int $interval): string |
|
43 | |||
44 | 5 | private function hit(string $key, Rate $rate): int |
|
57 | } |
||
58 |