From a67676abf963a6dabbdeafe8724e3874cce3a490 Mon Sep 17 00:00:00 2001 From: Jesper Noordsij Date: Wed, 1 Oct 2025 12:44:58 +0200 Subject: [PATCH 1/2] Test against PHP 8.5 --- .github/workflows/ci.yaml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e5de6e6d..6e5d2ac1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -25,7 +25,7 @@ jobs: strategy: fail-fast: false matrix: - php: [ "8.4", "8.3", "8.2", "8.1" ] + php: [ "8.5", "8.4", "8.3", "8.2", "8.1" ] packages: # All versions below only support PHP ^8.1 (Laravel requirement) - { laravel: ^10.0, testbench: ^8.0, phpunit: 9.6.* } @@ -84,7 +84,7 @@ jobs: strategy: fail-fast: false matrix: - php: [ "8.4", "8.3", "8.2", "8.1", "8.0", "7.4", "7.3", "7.2" ] + php: [ "8.5", "8.4", "8.3", "8.2", "8.1", "8.0", "7.4", "7.3", "7.2" ] packages: # All versions below should be test on PHP ^7.1 (Sentry SDK requirement) and PHP < 8.0 (PHPUnit requirement) - { laravel: ^6.0, testbench: 4.7.*, phpunit: 8.4.* } @@ -136,6 +136,13 @@ jobs: - php: "8.4" packages: { laravel: ^8.0, testbench: ^6.0, phpunit: 9.3.* } + - php: "8.5" + packages: { laravel: ^6.0, testbench: 4.7.*, phpunit: 8.4.* } + - php: "8.5" + packages: { laravel: ^7.0, testbench: 5.1.*, phpunit: 8.4.* } + - php: "8.5" + packages: { laravel: ^8.0, testbench: ^6.0, phpunit: 9.3.* } + name: phpunit (PHP:${{ matrix.php }}, Laravel:${{ matrix.packages.laravel }}) steps: From 4b510bfb1ac5300ebe0c24c145cff10e5dbef14c Mon Sep 17 00:00:00 2001 From: Jesper Noordsij Date: Wed, 1 Oct 2025 13:05:10 +0200 Subject: [PATCH 2/2] Disable no-op calls to setAccessible for PHP < 8.1 in tests --- test/Sentry/TestCase.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/test/Sentry/TestCase.php b/test/Sentry/TestCase.php index f344ca73..ec8d0478 100644 --- a/test/Sentry/TestCase.php +++ b/test/Sentry/TestCase.php @@ -125,7 +125,11 @@ protected function getCurrentSentryScope(): Scope $hub = $this->getSentryHubFromContainer(); $method = new ReflectionMethod($hub, 'getScope'); - $method->setAccessible(true); + if (\PHP_VERSION_ID < 80100) + { + // This method is no-op starting from PHP 8.1; see also https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_reflectionsetaccessible + $method->setAccessible(true); + } return $method->invoke($hub); } @@ -136,7 +140,11 @@ protected function getCurrentSentryBreadcrumbs(): array $scope = $this->getCurrentSentryScope(); $property = new ReflectionProperty($scope, 'breadcrumbs'); - $property->setAccessible(true); + if (\PHP_VERSION_ID < 80100) + { + // This method is no-op starting from PHP 8.1; see also https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_reflectionsetaccessible + $property->setAccessible(true); + } return $property->getValue($scope); }