Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
60 | 1 | public function resetAt(): float |
|
61 | { |
||
62 | 1 | $timestamp = 0.0; |
|
63 | |||
64 | 1 | foreach ($this->rateLimits as $rateLimit) { |
|
65 | 1 | if ($rateLimit->wasReached()) { |
|
66 | 1 | $timestamp = max($rateLimit->resetsAt() ?? 0.0, $timestamp); |
|
67 | |||
68 | 1 | $rateLimit->reset(); |
|
69 | } |
||
70 | } |
||
71 | |||
72 | 1 | return $timestamp; |
|
73 | } |
||
75 |