| Conditions | 8 |
| Paths | 9 |
| Total Lines | 17 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 3 |
| CRAP Score | 39.042 |
| Changes | 3 | ||
| Bugs | 1 | Features | 2 |
| 1 | <?php |
||
| 49 | 3 | public function wait($block = false, $interval = 100) |
|
| 50 | { |
||
| 51 | do { |
||
| 52 | 3 | if ($this->isFinished()) { |
|
| 53 | 3 | return; |
|
| 54 | } |
||
| 55 | parent::wait(false); |
||
| 56 | if ($this->aliveCount() < $this->max) { |
||
| 57 | foreach ($this->processes as $process) { |
||
| 58 | if ($process->isStarted()) continue; |
||
| 59 | $process->start(); |
||
| 60 | if ($this->aliveCount() >= $this->max) break; |
||
| 61 | } |
||
| 62 | } |
||
| 63 | $block ? usleep($interval) : null; |
||
| 64 | } while ($block); |
||
| 65 | } |
||
| 66 | |||
| 67 | } |