src/Factory.php
private static function getGuzzleClient($baseUrl, $options = [])
    {
        $guzzleOptions = [];
        if (isset($options[self::PROXY])) {
            $guzzleOptions[self::PROXY] = $options[self::PROXY];
        }
        if (isset($options[self::GUZZLE_OPTIONS])) {
            $guzzleOptions = array_merge($guzzleOptions, $options[self::GUZZLE_OPTIONS]);
        }

        $handlerStack = HandlerStack::create();
        $handlerStack->unshift(Middleware::retry(self::retryDecider(), self::retryDelay()));
        $options = array_merge(['base_uri' => $baseUrl, 'handler' => $handlerStack], $guzzleOptions);

        return new GuzzleClient($options);
    }
private static function getGuzzleClient($baseUrl, $options = [])
    {
        $guzzleOptions = [];
        if (isset($options[self::PROXY])) {
            $guzzleOptions[self::PROXY] = $options[self::PROXY];
        }
        if (isset($options[self::GUZZLE_OPTIONS])) {
            $guzzleOptions = array_merge($guzzleOptions, $options[self::GUZZLE_OPTIONS]);
        }

        $handlerStack = HandlerStack::create();
        $handlerStack->unshift(Middleware::retry(self::retryDecider(), self::retryDelay()));
        $options = array_merge(['base_uri' => $baseUrl, 'handler' => $handlerStack], $guzzleOptions);

        return new GuzzleClient($options);
    }
private static function getGuzzleClient ( $ baseUrl , $ options = [ ] ) { $ guzzleOptions = [ ] ; if ( isset ( $ options [ self :: PROXY ] ) ) { $ guzzleOptions [ self :: PROXY ] = $ options [ self :: PROXY ] ; } if ( isset ( $ options [ self :: GUZZLE_OPTIONS ] ) ) { $ guzzleOptions = array_merge ( $ guzzleOptions , $ options [ self :: GUZZLE_OPTIONS ] ) ; } $ handlerStack = HandlerStack :: create ( ) ; $ handlerStack -> unshift ( Middleware :: retry ( self :: retryDecider ( ) , self :: retryDelay ( ) ) ) ; $ options = array_merge ( [ 'base_uri' => $ baseUrl , 'handler' => $ handlerStack ] , $ guzzleOptions ) ; return new GuzzleClient ( $ options ) ; }
Returns a Guzzle client with a retry middleware.

@param string $baseUrl base url
@param array  $options

@throws \RuntimeException

@return GuzzleClient GuzzleClient to connect to the backend
Returns a Guzzle client with a retry middleware .