From e7a559257c0411ccab7f41d8f80550255e6c0ead Mon Sep 17 00:00:00 2001 From: Dawid 'DeyV' Polak Date: Mon, 23 Dec 2024 14:12:10 +0100 Subject: [PATCH 1/2] allow for 8.4 --- .github/workflows/ci.yaml | 14 +++++++------- composer.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index cbb4977..5b4b63c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -35,7 +35,7 @@ jobs: matrix: include: - operating-system: "ubuntu-latest" - php-version: "8.3" + php-version: "8.4" steps: - name: "Checkout" @@ -68,7 +68,7 @@ jobs: matrix: include: - operating-system: "ubuntu-latest" - php-version: "8.3" + php-version: "8.4" steps: - name: "Checkout" @@ -101,7 +101,7 @@ jobs: strategy: matrix: operating-system: [ "ubuntu-latest" ] - php-version: [ "7.4", "8.0", "8.1", "8.2", "8.3" ] + php-version: [ "7.4", "8.0", "8.1", "8.2", "8.3", "8.4"] composer-flags: [ "" ] experimental: [ false ] include: @@ -114,11 +114,11 @@ jobs: composer-flags: "--ignore-platform-req=php+" experimental: true - operating-system: "macos-latest" - php-version: "8.3" + php-version: "8.4" composer-flags: "" experimental: false - operating-system: "windows-latest" - php-version: "8.3" + php-version: "8.4" composer-flags: "" experimental: false @@ -170,7 +170,7 @@ jobs: matrix: include: - operating-system: "ubuntu-latest" - php-version: "8.3" + php-version: "8.4" steps: - name: "Coveralls" @@ -190,7 +190,7 @@ jobs: matrix: include: - operating-system: "ubuntu-latest" - php-version: "8.3" + php-version: "8.4" steps: - name: "Checkout" diff --git a/composer.json b/composer.json index d324b41..02a1d5f 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": "7.4 - 8.3", + "php": "7.4 - 8.4", "ext-mbstring": "*", "symfony/polyfill-php80": "^1.18.1" }, From 70ba3b4db1f33580a53c97d280a666c6f0b7f2e6 Mon Sep 17 00:00:00 2001 From: Dawid 'DeyV' Polak Date: Fri, 2 Oct 2026 10:11:41 +0200 Subject: [PATCH 2/2] Support PHP 8.5 and 8.6 Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/ci.yaml | 18 +++++++++++------- CHANGELOG.md | 4 ++++ composer.json | 8 +++++++- src/ConfigurableException.php | 6 +++++- 4 files changed, 27 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0e5205d..eebac3d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -35,7 +35,7 @@ jobs: matrix: include: - operating-system: "ubuntu-latest" - php-version: "8.4" + php-version: "8.5" steps: - name: "Checkout" @@ -68,7 +68,7 @@ jobs: matrix: include: - operating-system: "ubuntu-latest" - php-version: "8.4" + php-version: "8.5" steps: - name: "Checkout" @@ -101,7 +101,7 @@ jobs: strategy: matrix: operating-system: [ "ubuntu-latest" ] - php-version: [ "7.4", "8.0", "8.1", "8.2", "8.3", "8.4" ] + php-version: [ "7.4", "8.0", "8.1", "8.2", "8.3", "8.4", "8.5" ] composer-flags: [ "" ] experimental: [ false ] include: @@ -109,12 +109,16 @@ jobs: php-version: "7.4" composer-flags: "--prefer-lowest --prefer-stable" experimental: false + - operating-system: "ubuntu-latest" + php-version: "8.6" + composer-flags: "--ignore-platform-req=php+" + experimental: true - operating-system: "macos-latest" - php-version: "8.4" + php-version: "8.5" composer-flags: "" experimental: false - operating-system: "windows-latest" - php-version: "8.4" + php-version: "8.5" composer-flags: "" experimental: false @@ -166,7 +170,7 @@ jobs: matrix: include: - operating-system: "ubuntu-latest" - php-version: "8.4" + php-version: "8.5" steps: - name: "Coveralls" @@ -186,7 +190,7 @@ jobs: matrix: include: - operating-system: "ubuntu-latest" - php-version: "8.4" + php-version: "8.5" steps: - name: "Checkout" diff --git a/CHANGELOG.md b/CHANGELOG.md index b7ca726..a4f31ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased](https://github.com/orisai/exceptions/compare/1.1.5...v1.x) +### Added + +- Support for PHP 8.5 and 8.6 + ## [1.1.5](https://github.com/orisai/exceptions/compare/1.1.4...1.1.5) - 2024-12-29 ### Changed diff --git a/composer.json b/composer.json index 3d40867..e6236e3 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": "7.4 - 8.4", + "php": "7.4 - 8.6", "ext-mbstring": "*", "symfony/polyfill-php80": "^1.18.1" }, @@ -42,6 +42,12 @@ "Tests\\Orisai\\Exceptions\\": "tests" } }, + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/mentax/coding-standard-php" + } + ], "minimum-stability": "dev", "prefer-stable": true, "config": { diff --git a/src/ConfigurableException.php b/src/ConfigurableException.php index 825c852..8c5724c 100644 --- a/src/ConfigurableException.php +++ b/src/ConfigurableException.php @@ -14,6 +14,7 @@ use function preg_replace; use function str_repeat; use const PHP_EOL; +use const PHP_VERSION_ID; trait ConfigurableException { @@ -62,7 +63,10 @@ public function withPrevious(Throwable $throwable): self $reflection = new ReflectionClass(Exception::class); // phpcs:enable $property = $reflection->getProperty('previous'); - $property->setAccessible(true); + if (PHP_VERSION_ID < 80_100) { + $property->setAccessible(true); + } + $property->setValue($this, $throwable); return $this;