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..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"] + php-version: ["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']);