From f47d08fbd2ae1035816829215a0ef36b7d67d870 Mon Sep 17 00:00:00 2001 From: oligirling Date: Fri, 13 Feb 2026 07:05:32 +0000 Subject: [PATCH] Update to PHP 8.5 support, drop PHP 7.x (v2.0.0) Raise minimum PHP from 7.1 to 8.1 and add support through PHP 8.5. Update dev tooling (PHPUnit 10+/11+, php-mock-phpunit, phpunit.xml), Dockerfile, CI matrix, and remove deprecated calls (curl_close, setAccessible). Co-Authored-By: Claude Sonnet 4.5 --- .github/workflows/tests.yml | 5 +++-- CHANGELOG.md | 22 ++++++++++++++++++++++ Dockerfile | 2 +- README.md | 4 ++-- composer.json | 8 ++++---- phpunit.xml | 6 +++--- src/CurrencyApi.php | 1 - tests/CurrencyApiTest.php | 2 -- 8 files changed, 35 insertions(+), 15 deletions(-) create mode 100644 CHANGELOG.md diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 96b0522..b472aaa 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,16 +8,17 @@ jobs: strategy: matrix: - php-version: [7.3.x, 7.4.x, 8.1.x, 8.2.x] + php-version: ['8.1', '8.2', '8.3', '8.4', '8.5'] steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up PHP ${{ matrix.php-version }} uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} + coverage: xdebug - name: Install dependencies run: composer install diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..85d6104 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,22 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +## [2.0.0] - 2026-02-13 + +### Changed +- Minimum PHP version raised from 7.1 to 8.1. +- Updated PHPUnit from ^8.5|^9.6 to ^10.5|^11.5. +- Updated php-mock-phpunit from ^2.7 to ^2.10. +- Updated php-coveralls from ^2.6 to ^2.7. +- Updated phpunit.xml configuration to PHPUnit 10+ format. +- Updated Dockerfile default PHP version to 8.5. +- Updated GitHub Actions workflow to test PHP 8.1, 8.2, 8.3, 8.4, and 8.5. +- Updated GitHub Actions checkout action from v2 to v4. + +### Fixed +- Removed deprecated `curl_close()` call (no effect since PHP 8.0). +- Removed deprecated `ReflectionMethod::setAccessible()` and `ReflectionProperty::setAccessible()` calls in tests (no effect since PHP 8.1). + +### Removed +- Dropped support for PHP 7.x. diff --git a/Dockerfile b/Dockerfile index 4e11206..7554951 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG VERSION=8.3 +ARG VERSION=8.5 FROM php:$VERSION-alpine ARG APP_DIR=/application WORKDIR $APP_DIR diff --git a/README.md b/README.md index 4ae9364..760dae7 100644 --- a/README.md +++ b/README.md @@ -27,8 +27,8 @@ Alternatively keep reading below. #### Prerequisites -- Minimum PHP 7.1+ -- Working on PHP 8.2.10 +- Minimum PHP 8.1+ +- Working on PHP 8.5 - Free or Paid account with CurrencyApi.net - Composer or clone this repo diff --git a/composer.json b/composer.json index e8f5511..70c81ba 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": ">=7.1.0|^8", + "php": "^8.1", "ext-curl": "*", "ext-json": "*", "ext-simplexml": "*" @@ -25,8 +25,8 @@ } }, "require-dev": { - "phpunit/phpunit": "^8.5|^9.6", - "php-mock/php-mock-phpunit": "^2.7", - "php-coveralls/php-coveralls": "^2.6" + "phpunit/phpunit": "^10.5|^11.5", + "php-mock/php-mock-phpunit": "^2.10", + "php-coveralls/php-coveralls": "^2.7" } } diff --git a/phpunit.xml b/phpunit.xml index 89700ef..fb0b753 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,13 +1,13 @@ - - + + src/ src/Exceptions/ - + tests diff --git a/src/CurrencyApi.php b/src/CurrencyApi.php index 052f9db..c476ebd 100644 --- a/src/CurrencyApi.php +++ b/src/CurrencyApi.php @@ -440,7 +440,6 @@ protected function get(string $url, int $timeout = 5) : array throw new BadRequestException($message, $code); } - curl_close($ch); return $response; } } diff --git a/tests/CurrencyApiTest.php b/tests/CurrencyApiTest.php index c813b6a..312d465 100644 --- a/tests/CurrencyApiTest.php +++ b/tests/CurrencyApiTest.php @@ -38,7 +38,6 @@ public function invokeMethod(&$object, $methodName, array $parameters = array()) { $reflection = new ReflectionClass(get_class($object)); $method = $reflection->getMethod($methodName); - $method->setAccessible(true); return $method->invokeArgs($object, $parameters); } @@ -47,7 +46,6 @@ public function getProtectedProperty($object, $property) { $reflection = new \ReflectionClass($object); $reflection_property = $reflection->getProperty($property); - $reflection_property->setAccessible(true); return $reflection_property->getValue($object); }