/** * {@inheritdoc} */ public function createClient(array $config = []) { if (!class_exists('Http\\Adapter\\Guzzle6\\Client')) { throw new \LogicException('To use the Guzzle6 adapter you need to install the "php-http/guzzle6-adapter" package.'); } return Client::createWithConfig($config); }
/** * Return or generate github client on-demand * * @param OutputInterface $output * @return GithubClient */ protected function getGithubClient(OutputInterface $output) { if ($this->githubClient) { return $this->githubClient; } // Create authenticated github client $token = $this->getOAUTHToken($output); $client = new GithubClient(); $httpClient = GuzzleClient::createWithConfig(['http_errors' => false]); $client->setHttpClient($httpClient); $client->authenticate($token, null, GithubClient::AUTH_HTTP_TOKEN); // Cache $this->githubClient = $client; return $client; }
/** * @return \Http\Adapter\Guzzle6\Client */ public function createGuzzle6Driver() { return GuzzleSixAdapter::createWithConfig($this->getConfig('guzzle6')); }