private function findPort(array $portRange)
{
foreach (range(...$portRange) as $port) {
if ($this->isPortAvailable($port)) {
return $port;
}
}
throw new \RuntimeException(sprintf('Unable to find a suitable port in the range %d..%d', ...$portRange));
}