Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/Curl/HttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
}
Expand Down Expand Up @@ -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);
}
}
}