| Conditions | 6 |
| Paths | 7 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 47 | 9 | public function sleep() |
|
| 48 | 9 | { |
|
| 49 | 9 | $now = microtime(true); |
|
| 50 | 9 | $min = null; |
|
| 51 | 9 | foreach ($this->untils as $id => $until) { |
|
| 52 | 4 | $diff = $until - $now; |
|
| 53 | 4 | if ($diff < 0) { |
|
| 54 | // @codeCoverageIgnoreStart |
||
| 55 | return; |
||
| 56 | // @codeCoverageIgnoreEnd |
||
| 57 | } |
||
| 58 | 4 | if ($min !== null && $diff >= $min) { |
|
| 59 | 2 | continue; |
|
| 60 | } |
||
| 61 | 4 | $min = $diff; |
|
| 62 | } |
||
| 63 | 9 | $min && usleep($min * 1000000); |
|
| 64 | 9 | } |
|
| 65 | |||
| 91 |