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