Compatibility patch for eway/eway-rapid-php when used with PHP 8.5, including Magento 2.4.9 installations.
PHP 8.5 deprecates curl_close().
eway/eway-rapid-php explicitly calls curl_close() in Rapid\Service\Http\Curl::close(), which results in a deprecation warning when running the package on PHP 8.5.
The patch replaces:
curl_close($this->handler);with:
$this->handler = null;Since cURL handles have been represented by CurlHandle objects since PHP 8.0, releasing the reference allows the handle to be cleaned up without calling the deprecated curl_close() function.
This patch was created while upgrading a Magento installation to:
- Magento 2.4.9
- PHP 8.5
eway/eway-rapid-php
The patch can be applied to the eway/eway-rapid-php package using a Composer patches plugin.
Example:
{
"extra": {
"patches": {
"eway/eway-rapid-php": {
"curl_close deprecated": "https://raw.githubusercontent.com/magenable/eway-rapid-php-php85-patch/master/eway-rapid-php-php8-curl-close-issue.patch"
}
}
}
}MIT