Skip to content

Commit f729af8

Browse files
stofrobocoder
authored andcommitted
Fix deprecations triggered by PHP 8.5
The `curl_close` function is a no-op as of PHP 8.0 (when the curl extension migrated from resources to objects) and is deprecated as of PHP 8.5.
1 parent 345fa22 commit f729af8

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/WebDriver/Service/CurlService.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ public function execute($requestMethod, $url, $parameters = null, $extraOptions
8787
CURLE_GOT_NOTHING !== ($errno = curl_errno($curl)) &&
8888
$error = curl_error($curl)
8989
) {
90-
curl_close($curl);
90+
if (\PHP_VERSION_ID < 80000) {
91+
curl_close($curl);
92+
}
9193

9294
$e = new CurlExecException(
9395
sprintf(
@@ -104,8 +106,9 @@ public function execute($requestMethod, $url, $parameters = null, $extraOptions
104106

105107
throw $e;
106108
}
107-
108-
curl_close($curl);
109+
if (\PHP_VERSION_ID < 80000) {
110+
curl_close($curl);
111+
}
109112

110113
return [$rawResult, $info];
111114
}

0 commit comments

Comments
 (0)