| Conditions | 1 |
| Paths | 1 |
| Total Lines | 11 |
| Lines | 11 |
| Ratio | 100 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | View Code Duplication | public static function perSecond(int $limit, Store $store = null): RateLimiterMiddleware |
|
| 18 | { |
||
| 19 | $rateLimiter = new RateLimiter( |
||
| 20 | $limit, |
||
| 21 | RateLimiter::TIME_FRAME_SECOND, |
||
| 22 | $store ?? new InMemoryStore(), |
||
| 23 | new SleepDeferrer() |
||
| 24 | ); |
||
| 25 | |||
| 26 | return new static($rateLimiter); |
||
| 27 | } |
||
| 28 | |||
| 50 |