public function waitServer(int $timeout = 10)
{
$start = time();
while (time() - $start <= $timeout) {
usleep(10000);
if (!$this->process->isRunning()) {
continue;
}
try {
file_get_contents(sprintf('http://%s/', $this->address));
return true;
} catch (\Throwable $e) {
}
}
throw new \RuntimeException('Server is not responding');
}