Skip to content

Commit e1ca1c8

Browse files
authored
Alllow PHP 8.4 (#62)
PHP 8.4 support. This PR adds official support for PHP 8.4. There was a change necessary in the package, which requires loading WordPress 6.7 as stubs instead of `latest` (6.8 - May 2025) to not cause static analyzers to fail in PHP 7.4 due to a syntax error. This will be reverted in the future when php-stubs/wordpress-stubs#277 is fixed and released.
1 parent 83d7468 commit e1ca1c8

5 files changed

Lines changed: 15 additions & 8 deletions

File tree

.github/workflows/php-qa.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
uses: inpsyde/reusable-workflows/.github/workflows/lint-php.yml@main
3939
strategy:
4040
matrix:
41-
php: [ '7.4', '8.0', '8.1', '8.2', '8.3' ]
41+
php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
4242
with:
4343
PHP_VERSION: ${{ matrix.php }}
4444
LINT_ARGS: '-e php --colors --show-deprecated ./src'
@@ -54,7 +54,7 @@ jobs:
5454
uses: inpsyde/reusable-workflows/.github/workflows/static-analysis-php.yml@main
5555
strategy:
5656
matrix:
57-
php: [ '7.4', '8.0', '8.1', '8.2', '8.3' ]
57+
php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
5858
include:
5959
- php: '7.4'
6060
composer: '--ignore-platform-req=php'

.github/workflows/php-unit-tests.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929

3030
strategy:
3131
matrix:
32-
php: [ '7.4', '8.0', '8.1', '8.2', '8.3' ]
32+
php: [ '7.4', '8.0', '8.1', '8.2', '8.3']
3333
container-version: [ '^1.1.0', '^2' ]
3434
dependency-versions: [ 'lowest', 'highest' ]
3535
include:
@@ -55,7 +55,7 @@ jobs:
5555

5656
- name: Setup dependencies for PSR-11 target version
5757
run: |
58-
composer remove inpsyde/php-coding-standards --dev --no-update
58+
composer remove syde/phpcs --dev --no-update
5959
composer require "psr/container:${{ matrix.container-version }}" --no-update
6060
composer config --no-plugins allow-plugins.roots/wordpress-core-installer false
6161
@@ -76,3 +76,9 @@ jobs:
7676
files: ./coverage.xml
7777
flags: unittests
7878
verbose: true
79+
# PHP 8.4 causes many failures with "lowest" dependency version due incompatibility.
80+
# So, we're running it in an isolated step.
81+
test-phpunit-84:
82+
uses: inpsyde/reusable-workflows/.github/workflows/tests-unit-php.yml@main
83+
with:
84+
PHP_VERSION: "8.4"

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
}
2222
],
2323
"require": {
24-
"php": ">=7.4 <8.4",
24+
"php": ">=7.4",
2525
"ext-json": "*",
2626
"psr/container": "^1.1.0 || ^2"
2727
},
2828
"require-dev": {
2929
"brain/monkey": "^2.6.1",
30-
"inpsyde/wp-stubs-versions": "dev-latest",
30+
"inpsyde/wp-stubs-versions": "6.7",
3131
"mikey179/vfsstream": "^v1.6.11",
3232
"phpstan/phpstan": "^2.1.1",
3333
"phpstan/phpstan-deprecation-rules": "^2.0.1",

phpstan.neon.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ parameters:
88
dynamicConstantNames:
99
- WP_DEBUG
1010
scanFiles:
11-
- vendor/inpsyde/wp-stubs-versions/latest.php
11+
- vendor/inpsyde/wp-stubs-versions/6.7.php
1212
paths:
1313
- src/
1414
- tests/

phpunit.xml.dist

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
convertWarningsToExceptions="true"
1010
convertDeprecationsToExceptions="false"
1111
backupGlobals="false"
12-
stopOnFailure="false">
12+
stopOnFailure="false"
13+
failOnWarning="false">
1314

1415
<php>
1516
<ini name="error_reporting" value="E_ALL"/>

0 commit comments

Comments
 (0)