public function setHttpClient(Client $client = null)
    {
        if ($client === null) {
            $client = new Client(
                HttpClientDiscovery::find(),
                MessageFactoryDiscovery::find()
            );
        }
        $this->client = $client;
        return $this;
    }