public function config($newConfig = null)
    {
        if ($newConfig === null) {
            return $this->clientConfig;
        }

        $this->clientConfig = $this->initConfig($newConfig);

        $this->httpClient = new HttpClient([
            'base_uri' => $this->clientConfig['url'],
            'timeout' => $this->clientConfig['timeout'],
            'handler' => $this->clientConfig['handler'],
        ]);

        return $this;
    }
public function config($newConfig = null)
    {
        if ($newConfig === null) {
            return $this->clientConfig;
        }

        $this->clientConfig = $this->initConfig($newConfig);

        $this->httpClient = new HttpClient([
            'base_uri' => $this->clientConfig['url'],
            'timeout' => $this->clientConfig['timeout'],
            'handler' => $this->clientConfig['handler'],
        ]);

        return $this;
    }
public function config ( $ newConfig = null ) { if ( $ newConfig === null ) { return $ this -> clientConfig ; } $ this -> clientConfig = $ this -> initConfig ( $ newConfig ) ; $ this -> httpClient = new HttpClient ( [ 'base_uri' => $ this -> clientConfig [ 'url' ] , 'timeout' => $ this -> clientConfig [ 'timeout' ] , 'handler' => $ this -> clientConfig [ 'handler' ] , ] ) ; return $ this ; }
Sets or gets the client configuration.

If a new configuration is passed as the first argument, it will be merged
with the existing configuration. If no new configuration is given, the old
configuration is returned.

@param array|null $newConfig New configuration to use.
@return array|Client Returns the client instance if a new configuration is passed
Sets or gets the client configuration .