| Conditions | 4 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | public function wait(Process $process) |
||
| 33 | { |
||
| 34 | $start = microtime(true); |
||
| 35 | $end = $start + $this->timeout / 1000; |
||
| 36 | |||
| 37 | while (!$process->isTerminated() && (microtime(true) < $end)) { |
||
| 38 | usleep(self::TICK * 1000); |
||
| 39 | } |
||
| 40 | |||
| 41 | if ($process->isRunning()) { |
||
| 42 | $callback = $this->callback; |
||
| 43 | $callback(); |
||
| 44 | } |
||
| 45 | |||
| 46 | $process->wait(); |
||
| 47 | } |
||
| 48 | } |
||
| 49 |