diff --git a/composer.json b/composer.json index 4868bdea..82f48b68 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,7 @@ "ext-curl": "*", "ext-json": "*", "ext-mbstring": "*", - "guzzlehttp/guzzle":"^5.3.1|^6.5.8|^7.4.5" + "guzzlehttp/guzzle":"^7" }, "require-dev": { "phpunit/phpunit": "^9", diff --git a/src/Utils/HttpClient.php b/src/Utils/HttpClient.php index 8947fc72..a284d220 100644 --- a/src/Utils/HttpClient.php +++ b/src/Utils/HttpClient.php @@ -53,42 +53,9 @@ public function request( $requestTimeout = $options['timeout'] ?? 0; - if (defined('\GuzzleHttp\Client::VERSION') && version_compare(Client::VERSION, '6', '<')) { - return $this->sendGuzzle5Request($method, $url, $headers, $payload, $requestTimeout); - } - return $this->sendGuzzleRequest($method, $url, $headers, $payload, $requestTimeout); } - /** - * Sends a Guzzle 5 request. - * - * @param string $method - * @param string $url - * @param array $headers - * @param array|null $payload - * @param int $timeout - * - * @throws GuzzleException - * - * @return ResponseInterface - */ - protected function sendGuzzle5Request($method, $url, array $headers, $payload, int $timeout): ResponseInterface - { - $client = new Client([ - 'timeout' => $timeout, - 'read_timeout' => $timeout, - 'connect_timeout' => $timeout, - ]); - - $request = $client->createRequest($method, $url, [ - 'headers' => $headers, - 'body' => $payload, - ]); - - return $client->send($request); - } - /** * Sends a Guzzle request. *