lib/Elastica/Transport/Guzzle.php
protected function _getBaseUrl(Connection $connection): string
    {
        // If url is set, url is taken. Otherwise port, host and path
        $url = $connection->hasConfig('url') ? $connection->getConfig('url') : '';

        if (!empty($url)) {
            $baseUri = $url;
        } else {
            $baseUri = (string) Uri::fromParts([
                'scheme' => $this->_scheme,
                'host' => $connection->getHost(),
                'port' => $connection->getPort(),
                'path' => \ltrim('/', $connection->getPath()),
            ]);
        }

        return \rtrim($baseUri, '/');
    }
protected function _getBaseUrl(Connection $connection): string
    {
        // If url is set, url is taken. Otherwise port, host and path
        $url = $connection->hasConfig('url') ? $connection->getConfig('url') : '';

        if (!empty($url)) {
            $baseUri = $url;
        } else {
            $baseUri = (string) Uri::fromParts([
                'scheme' => $this->_scheme,
                'host' => $connection->getHost(),
                'port' => $connection->getPort(),
                'path' => \ltrim('/', $connection->getPath()),
            ]);
        }

        return \rtrim($baseUri, '/');
    }
protected function _getBaseUrl ( Connection $ connection ) : string { // If url is set, url is taken. Otherwise port, host and path $ url = $ connection -> hasConfig ( 'url' ) ? $ connection -> getConfig ( 'url' ) : '' ; if ( ! empty ( $ url ) ) { $ baseUri = $ url ; } else { $ baseUri = ( string ) Uri :: fromParts ( [ 'scheme' => $ this -> _scheme , 'host' => $ connection -> getHost ( ) , 'port' => $ connection -> getPort ( ) , 'path' => \ ltrim ( '/' , $ connection -> getPath ( ) ) , ] ) ; } return \ rtrim ( $ baseUri , '/' ) ; }
Builds the base url for the guzzle connection.

@param Connection $connection

@return string
Builds the base url for the guzzle connection .