From 0ed6d2ee1b616489b731e26fc5f32a8bf0ba5e7f Mon Sep 17 00:00:00 2001 From: Nicholas Ciechanowski Date: Wed, 22 Apr 2026 15:44:09 +1000 Subject: [PATCH 1/4] ci: fix backwards compatibility check --- .github/workflows/backwards-compatibility.yml | 2 +- .github/workflows/ci.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/backwards-compatibility.yml b/.github/workflows/backwards-compatibility.yml index 8d13b2d512e..dcedc804d1c 100644 --- a/.github/workflows/backwards-compatibility.yml +++ b/.github/workflows/backwards-compatibility.yml @@ -15,7 +15,7 @@ jobs: - name: Install PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.2' + php-version: '8.5' - name: Install roave/backward-compatibility-check run: composer require --dev roave/backward-compatibility-check diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 41f45b1db91..e2b14de10fe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: strategy: fail-fast: false matrix: - php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4'] + php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] steps: - uses: actions/checkout@v6 From 11881a991f5a4fd261cd5f04d04dfcfe32c0ef2d Mon Sep 17 00:00:00 2001 From: Nicholas Ciechanowski Date: Wed, 22 Apr 2026 16:10:01 +1000 Subject: [PATCH 2/4] chore: bump phpstan --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index da450bc019d..0fdb370616e 100644 --- a/composer.json +++ b/composer.json @@ -37,9 +37,9 @@ "http-interop/http-factory-guzzle": "^1.0", "guzzlehttp/guzzle": "^7.2", "php-http/mock-client": "^1.4.1", - "phpstan/phpstan": "^0.12.57", + "phpstan/phpstan": "^1", "phpstan/extension-installer": "^1.0.5", - "phpstan/phpstan-deprecation-rules": "^0.12.5", + "phpstan/phpstan-deprecation-rules": "^1", "phpunit/phpunit": "^8.5 || ^9.4", "symfony/phpunit-bridge": "^5.2" }, From 54f89fba32a66e32b83711d5119079bd78af00d3 Mon Sep 17 00:00:00 2001 From: Nicholas Ciechanowski Date: Wed, 22 Apr 2026 16:20:53 +1000 Subject: [PATCH 3/4] fix: `setAccessible` for >= 8.5 --- test/Github/Tests/Api/TestCase.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/Github/Tests/Api/TestCase.php b/test/Github/Tests/Api/TestCase.php index 4fd6a49234c..381cda9e98a 100644 --- a/test/Github/Tests/Api/TestCase.php +++ b/test/Github/Tests/Api/TestCase.php @@ -42,7 +42,9 @@ protected function getApiMock() protected function getMethod($object, $methodName) { $method = new ReflectionMethod($object, $methodName); - $method->setAccessible(true); + if (version_compare(PHP_VERSION, '8.5.0', '<')) { + $method->setAccessible(true); + } return $method; } From fa105edcf32a0ec1308a074ef49864f6b6a3a900 Mon Sep 17 00:00:00 2001 From: Nicholas Ciechanowski Date: Wed, 22 Apr 2026 16:36:01 +1000 Subject: [PATCH 4/4] fix: phpstan old rules --- phpstan.neon.dist | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 3eb8c1138bf..50acd16370e 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -1,19 +1,48 @@ parameters: - checkMissingIterableValueType: false - level: 6 paths: - lib ignoreErrors: + - + identifier: missingType.iterableValue + # Ignore typehint errors on api classes - - message: '#Method (.*) with no typehint specified\.#' + identifier: missingType.return path: lib/Github/Api + - - message: '#Method (.*) has no return typehint specified\.#' + identifier: missingType.parameter path: lib/Github/Api - message: '#(extends|Instantiation of|typehint with) deprecated class Github\\Api\\#' path: lib/Github/Api + + # ResultPager writes this property through a bound closure. + - + identifier: property.onlyRead + count: 1 + path: lib/Github/Api/AbstractApi.php + + - + identifier: empty.variable + count: 1 + path: lib/Github/Api/AbstractApi.php + + - + identifier: booleanOr.rightAlwaysFalse + count: 1 + path: lib/Github/Api/Repository/Assets.php + + - + identifier: greater.alwaysTrue + count: 1 + path: lib/Github/ResultPager.php + + - + identifier: method.deprecated + message: '#^Call to deprecated method postFetch\(\) of class Github\\ResultPager:#' + count: 2 + path: lib/Github/ResultPager.php