Jderusse\Warmup\Compiler\PhpServerCompiler::findPort PHP Method

findPort() private method

private findPort ( array $portRange )
$portRange array
    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));
    }