From f513344a3a5db0601888258efcf53160e7309a51 Mon Sep 17 00:00:00 2001 From: SimonZanta Date: Mon, 15 Dec 2025 09:10:54 +0100 Subject: [PATCH 1/4] - upgrade to php 8.5 - check for deprecated stuff --- .github/workflows/method_sync_tests.yml | 2 +- .github/workflows/tests.yml | 2 +- src/Http/Transport.php | 6 +++++- tests/Integration/PaymentMethodSyncCest.php | 8 +++++++- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/method_sync_tests.yml b/.github/workflows/method_sync_tests.yml index e59e99b..8055ff8 100644 --- a/.github/workflows/method_sync_tests.yml +++ b/.github/workflows/method_sync_tests.yml @@ -18,7 +18,7 @@ jobs: runs-on: "${{ matrix.operating-system }}" strategy: matrix: - php-version: ["8.0"] + php-version: ["8.5"] operating-system: ["ubuntu-latest"] composer-args: [ "" ] fail-fast: false diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8399c1d..3a6e8b7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,7 +15,7 @@ jobs: runs-on: "${{ matrix.operating-system }}" strategy: matrix: - php-version: ["8.0"] + php-version: ["8.0", "8.5"] operating-system: ["ubuntu-latest"] composer-args: [ "" ] fail-fast: false diff --git a/src/Http/Transport.php b/src/Http/Transport.php index 600fc21..4be30d2 100644 --- a/src/Http/Transport.php +++ b/src/Http/Transport.php @@ -77,7 +77,11 @@ public function post(string $urn, array $data, array $options = []): Response $this->logger->log(...$log); } - curl_close($curl); + // PHP 8.5+ automatically closes the handle + // for lower versions we need to close it manually + if(PHP_VERSION_ID < 80500){ + curl_close($curl); + } if ($e != '') { throw new ComgateException("Request failed: {$e}", 0); diff --git a/tests/Integration/PaymentMethodSyncCest.php b/tests/Integration/PaymentMethodSyncCest.php index 18094f7..d4e9332 100644 --- a/tests/Integration/PaymentMethodSyncCest.php +++ b/tests/Integration/PaymentMethodSyncCest.php @@ -78,7 +78,13 @@ private function getRemoteMethods(): array curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); $result = curl_exec($ch); - curl_close($ch); + + // PHP 8.5+ automatically closes the handle + // for lower versions we need to close it manually + if(PHP_VERSION_ID < 80500){ + curl_close($ch); + } + $parsed = yaml_parse($result); $availableMethods = array_keys($parsed['paths']); From cce9f44d4624b4fae33626cefa971d4afa84a1c2 Mon Sep 17 00:00:00 2001 From: SimonZanta Date: Mon, 15 Dec 2025 09:12:19 +0100 Subject: [PATCH 2/4] Revert "- upgrade to php 8.5" This reverts commit f513344a3a5db0601888258efcf53160e7309a51. --- .github/workflows/method_sync_tests.yml | 2 +- .github/workflows/tests.yml | 2 +- src/Http/Transport.php | 6 +----- tests/Integration/PaymentMethodSyncCest.php | 8 +------- 4 files changed, 4 insertions(+), 14 deletions(-) diff --git a/.github/workflows/method_sync_tests.yml b/.github/workflows/method_sync_tests.yml index 8055ff8..e59e99b 100644 --- a/.github/workflows/method_sync_tests.yml +++ b/.github/workflows/method_sync_tests.yml @@ -18,7 +18,7 @@ jobs: runs-on: "${{ matrix.operating-system }}" strategy: matrix: - php-version: ["8.5"] + php-version: ["8.0"] operating-system: ["ubuntu-latest"] composer-args: [ "" ] fail-fast: false diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3a6e8b7..8399c1d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,7 +15,7 @@ jobs: runs-on: "${{ matrix.operating-system }}" strategy: matrix: - php-version: ["8.0", "8.5"] + php-version: ["8.0"] operating-system: ["ubuntu-latest"] composer-args: [ "" ] fail-fast: false diff --git a/src/Http/Transport.php b/src/Http/Transport.php index 4be30d2..600fc21 100644 --- a/src/Http/Transport.php +++ b/src/Http/Transport.php @@ -77,11 +77,7 @@ public function post(string $urn, array $data, array $options = []): Response $this->logger->log(...$log); } - // PHP 8.5+ automatically closes the handle - // for lower versions we need to close it manually - if(PHP_VERSION_ID < 80500){ - curl_close($curl); - } + curl_close($curl); if ($e != '') { throw new ComgateException("Request failed: {$e}", 0); diff --git a/tests/Integration/PaymentMethodSyncCest.php b/tests/Integration/PaymentMethodSyncCest.php index d4e9332..18094f7 100644 --- a/tests/Integration/PaymentMethodSyncCest.php +++ b/tests/Integration/PaymentMethodSyncCest.php @@ -78,13 +78,7 @@ private function getRemoteMethods(): array curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); $result = curl_exec($ch); - - // PHP 8.5+ automatically closes the handle - // for lower versions we need to close it manually - if(PHP_VERSION_ID < 80500){ - curl_close($ch); - } - + curl_close($ch); $parsed = yaml_parse($result); $availableMethods = array_keys($parsed['paths']); From 62e75311f6ed589207cab5fdc5cccacc43a5b09f Mon Sep 17 00:00:00 2001 From: SimonZanta Date: Mon, 15 Dec 2025 09:13:26 +0100 Subject: [PATCH 3/4] - upgrade to php 8.5 - check for deprecated stuff --- .github/workflows/method_sync_tests.yml | 2 +- .github/workflows/tests.yml | 2 +- src/Http/Transport.php | 6 +++++- tests/Integration/PaymentMethodSyncCest.php | 6 +++++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/method_sync_tests.yml b/.github/workflows/method_sync_tests.yml index e59e99b..8055ff8 100644 --- a/.github/workflows/method_sync_tests.yml +++ b/.github/workflows/method_sync_tests.yml @@ -18,7 +18,7 @@ jobs: runs-on: "${{ matrix.operating-system }}" strategy: matrix: - php-version: ["8.0"] + php-version: ["8.5"] operating-system: ["ubuntu-latest"] composer-args: [ "" ] fail-fast: false diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8399c1d..3a6e8b7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,7 +15,7 @@ jobs: runs-on: "${{ matrix.operating-system }}" strategy: matrix: - php-version: ["8.0"] + php-version: ["8.0", "8.5"] operating-system: ["ubuntu-latest"] composer-args: [ "" ] fail-fast: false diff --git a/src/Http/Transport.php b/src/Http/Transport.php index 600fc21..17da99e 100644 --- a/src/Http/Transport.php +++ b/src/Http/Transport.php @@ -77,7 +77,11 @@ public function post(string $urn, array $data, array $options = []): Response $this->logger->log(...$log); } - curl_close($curl); + // PHP 8.5+ automatically closes the handle + // for lower versions we need to close it manually + if(PHP_VERSION_ID < 80500){ + curl_close($curl); + }; if ($e != '') { throw new ComgateException("Request failed: {$e}", 0); diff --git a/tests/Integration/PaymentMethodSyncCest.php b/tests/Integration/PaymentMethodSyncCest.php index 18094f7..0feeb54 100644 --- a/tests/Integration/PaymentMethodSyncCest.php +++ b/tests/Integration/PaymentMethodSyncCest.php @@ -78,7 +78,11 @@ private function getRemoteMethods(): array curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); $result = curl_exec($ch); - curl_close($ch); + // PHP 8.5+ automatically closes the handle + // for lower versions we need to close it manually + if(PHP_VERSION_ID < 80500){ + curl_close($ch); + }; $parsed = yaml_parse($result); $availableMethods = array_keys($parsed['paths']); From 95696edf9494b1a30abf45198568c357a3b24ec2 Mon Sep 17 00:00:00 2001 From: SimonZanta Date: Mon, 15 Dec 2025 10:44:53 +0100 Subject: [PATCH 4/4] - try only 8.5 --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3a6e8b7..4c5d731 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,7 +15,7 @@ jobs: runs-on: "${{ matrix.operating-system }}" strategy: matrix: - php-version: ["8.0", "8.5"] + php-version: ["8.5"] operating-system: ["ubuntu-latest"] composer-args: [ "" ] fail-fast: false