From a5f29ca08c931640643c2f84c0771ee779ad9b8e Mon Sep 17 00:00:00 2001 From: Bruce Wells Date: Tue, 9 Dec 2025 15:45:08 -0500 Subject: [PATCH 1/4] Avoid depreciation notice in PHP 8.5 --- lib/Tinify/Client.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/Tinify/Client.php b/lib/Tinify/Client.php index 531b830..93bd513 100644 --- a/lib/Tinify/Client.php +++ b/lib/Tinify/Client.php @@ -112,7 +112,9 @@ function request($method, $url, $body = NULL) { if (is_string($response)) { $status = curl_getinfo($request, CURLINFO_HTTP_CODE); $headerSize = curl_getinfo($request, CURLINFO_HEADER_SIZE); - curl_close($request); + if (PHP_VERSION_ID < 80000) { + curl_close($request); + } $headers = self::parseHeaders(substr($response, 0, $headerSize)); $responseBody = substr($response, $headerSize); @@ -140,7 +142,9 @@ function request($method, $url, $body = NULL) { throw Exception::create($details->message, $details->error, $status); } else { $message = sprintf("%s (#%d)", curl_error($request), curl_errno($request)); - curl_close($request); + if (PHP_VERSION_ID < 80000) { + curl_close($request); + } if ($retries > 0) continue; throw new ConnectionException("Error while connecting: " . $message); } From 534312f88025ae0524fa140564a6432c58d4d200 Mon Sep 17 00:00:00 2001 From: Bruce Wells Date: Tue, 9 Dec 2025 15:46:26 -0500 Subject: [PATCH 2/4] Add PHP 8.5 to tests --- .github/workflows/ci-cd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index d0ba89f..214caa1 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -16,7 +16,7 @@ jobs: "5.6", "7.4", "8.0", - "8.4", + "8.5", ] os: [ubuntu-latest, macOS-latest, windows-latest] steps: From 9b5930550d5f27466044fead2c9f3cdf6c9d049e Mon Sep 17 00:00:00 2001 From: Bruce Wells Date: Tue, 9 Dec 2025 15:49:12 -0500 Subject: [PATCH 3/4] Remove dynamic property depreciation notice --- test/curl_mock.php | 1 + 1 file changed, 1 insertion(+) diff --git a/test/curl_mock.php b/test/curl_mock.php index 9008924..8fe6a00 100644 --- a/test/curl_mock.php +++ b/test/curl_mock.php @@ -17,6 +17,7 @@ class CurlMock { private static $version = array(); public $options = array(); + public $request; public $response; public $closed = false; From ac9e6e77639e8c40bed644a2847ace100f963340 Mon Sep 17 00:00:00 2001 From: Bruce Wells Date: Tue, 9 Dec 2025 15:50:53 -0500 Subject: [PATCH 4/4] Anticipate V1.6.4 --- lib/Tinify.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Tinify.php b/lib/Tinify.php index 9e34876..80f533f 100644 --- a/lib/Tinify.php +++ b/lib/Tinify.php @@ -2,7 +2,7 @@ namespace Tinify; -const VERSION = "1.6.3"; +const VERSION = "1.6.4"; class Tinify { private static $key = NULL;