private function getHosts($options)
    {
        $hosts = [];

        if (is_string($options['servers'])) {
            $options['servers'] = explode(',', $options['servers']);
        }

        foreach ($options['servers'] as $host) {
            if (!empty($host)) {
                list($hostname, $port) = array_pad(explode(':', trim($host), 2), 2, 9200);
                $currentHostConfig = [
                    'host'   => $hostname,
                    'port'   => $port,
                    'scheme' => isset($options['enable_https_mode']) ? 'https' : $options['scheme'] ?? 'http',
                ];

                if ($options['enable_http_auth']) {
                    $currentHostConfig['user'] = $options['http_auth_user'];
                    $currentHostConfig['pass'] = $options['http_auth_pwd'];
                }

                $hosts[] = $currentHostConfig;
            }
        }

        return $hosts;
    }
private function getHosts($options)
    {
        $hosts = [];

        if (is_string($options['servers'])) {
            $options['servers'] = explode(',', $options['servers']);
        }

        foreach ($options['servers'] as $host) {
            if (!empty($host)) {
                list($hostname, $port) = array_pad(explode(':', trim($host), 2), 2, 9200);
                $currentHostConfig = [
                    'host'   => $hostname,
                    'port'   => $port,
                    'scheme' => isset($options['enable_https_mode']) ? 'https' : $options['scheme'] ?? 'http',
                ];

                if ($options['enable_http_auth']) {
                    $currentHostConfig['user'] = $options['http_auth_user'];
                    $currentHostConfig['pass'] = $options['http_auth_pwd'];
                }

                $hosts[] = $currentHostConfig;
            }
        }

        return $hosts;
    }
private function getHosts ( $ options ) { $ hosts = [ ] ; if ( is_string ( $ options [ 'servers' ] ) ) { $ options [ 'servers' ] = explode ( ',' , $ options [ 'servers' ] ) ; } foreach ( $ options [ 'servers' ] as $ host ) { if ( ! empty ( $ host ) ) { list ( $ hostname , $ port ) = array_pad ( explode ( ':' , trim ( $ host ) , 2 ) , 2 , 9200 ) ; $ currentHostConfig = [ 'host' => $ hostname , 'port' => $ port , 'scheme' => isset ( $ options [ 'enable_https_mode' ] ) ? 'https' : $ options [ 'scheme' ] ?? 'http' , ] ; if ( $ options [ 'enable_http_auth' ] ) { $ currentHostConfig [ 'user' ] = $ options [ 'http_auth_user' ] ; $ currentHostConfig [ 'pass' ] = $ options [ 'http_auth_pwd' ] ; } $ hosts [ ] = $ currentHostConfig ; } } return $ hosts ; }
Return hosts config used to connect to the cluster.

@param array $options Client options. See self::defaultOptions for available options.

@return array
Return hosts config used to connect to the cluster .