diff --git a/src/Curl/HttpClient.php b/src/Curl/HttpClient.php index 7bfadcb..2c03b3c 100644 --- a/src/Curl/HttpClient.php +++ b/src/Curl/HttpClient.php @@ -45,7 +45,7 @@ private function prepareRequestHttpClient(RequestInterface $request) if ($httpClient === false) { throw NetworkException::withRequest( - 'Cannot prepare HTTP client: ' . curl_error($httpClient), + 'Cannot prepare HTTP client', $request ); } @@ -103,6 +103,9 @@ private function execute(RequestInterface $request, $httpClient): ResponseInterf private function closeHttpClient($httpClient) { - curl_close($httpClient); + // curl_close() has no effect since PHP 8.0 and is deprecated since PHP 8.5 + if (PHP_VERSION_ID < 80000) { + curl_close($httpClient); + } } }