public static function detectCmdLocationInPaths($cmd, array $paths) : string
    {
        foreach ($paths as $path) {
            $command = $path . DIRECTORY_SEPARATOR . $cmd;
            $bin     = self::getExecutable($command);
            if (null !== $bin) {
                return $bin;
            }
        }
        return '';
    }