PhpBench\Benchmark\Remote\Launcher::resolvePhpBinary PHP Method

resolvePhpBinary() private method

private resolvePhpBinary ( )
    private function resolvePhpBinary()
    {
        // if no php binary, use the PhpExecutableFinder (generally will
        // resolve to PHP_BINARY)
        if (!$this->phpBinary) {
            $finder = new PhpExecutableFinder();
            return $finder->find();
        }
        // if the php binary is absolute, fine.
        if (substr($this->phpBinary, 0, 1) === '/') {
            return $this->phpBinary;
        }
        // otherwise try and find it in PATH etc.
        $phpBinary = $this->finder->find($this->phpBinary);
        if (null === $phpBinary) {
            throw new \InvalidArgumentException(sprintf('Could not find PHP binary "%s"', $this->phpBinary));
        }
        return $phpBinary;
    }