Skip to content

Commit 0a435c4

Browse files
authored
feat: official support for php8.4 (#522)
fixes #500 --------- Signed-off-by: Jan Kowalleck <[email protected]>
1 parent 2ece10e commit 0a435c4

File tree

5 files changed

+35
-19
lines changed

5 files changed

+35
-19
lines changed

.github/workflows/php-dev.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ concurrency:
2525
cancel-in-progress: true
2626

2727
env:
28-
PHP_VERSION_LATEST: "8.3"
28+
PHP_VERSION_LATEST: "8.4"
2929
PHP_PROJECT_EXT: dom,json,libxml # via `composer info -pt`
3030

3131
jobs:
@@ -37,7 +37,7 @@ jobs:
3737
matrix:
3838
os: [ "ubuntu-latest", "macos-latest", "windows-latest" ]
3939
php:
40-
- "8.3" # highest supported
40+
- "8.4" # highest supported
4141
- "8.1" # lowest supported
4242
timeout-minutes: 30
4343
steps:

.github/workflows/php.yml

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ concurrency:
1818
cancel-in-progress: true
1919

2020
env:
21-
PHP_VERSION_LATEST: "8.3"
21+
PHP_VERSION_LOWEST: "8.1" # lowest supported
22+
PHP_VERSION_LATEST: "8.4" # highest supported
2223
PHP_PROJECT_EXT: dom,json,libxml # via `composer info -pt`
2324
REPORTS_DIR: CI_reports
2425
TESTS_REPORTS_ARTIFACT: tests-reports
@@ -51,18 +52,19 @@ jobs:
5152
matrix:
5253
os: [ "ubuntu-latest" ]
5354
php:
54-
- "8.3" # highest supported
55+
- "8.4" # highest supported
56+
- "8.3"
5557
- "8.2"
5658
- "8.1" # lowest supported
5759
dependencies: [ "lowest", "highest" ]
5860
include:
5961
- # Windows highest
6062
os: windows-latest
61-
php: "8.3"
63+
php: "8.4"
6264
dependencies: "highest"
6365
- # MacOS highest
6466
os: macos-latest
65-
php: "8.3"
67+
php: "8.4"
6668
dependencies: "highest"
6769
timeout-minutes: 30
6870
steps:
@@ -103,7 +105,6 @@ jobs:
103105
# removing security-foo here is fine, as no code is run, only parsed
104106
composer remove --dev 'roave/security-advisories' \
105107
--no-update --no-install
106-
composer config platform.php ${{ matrix.php }}
107108
composer update \
108109
--no-interaction --no-progress \
109110
--prefer-dist \
@@ -160,7 +161,7 @@ jobs:
160161
fail-fast: false
161162
matrix:
162163
php:
163-
- "8.3" # highest supported
164+
- "8.4" # highest supported
164165
- "8.1" # lowest supported
165166
composer:
166167
- "v2" # latest 2.x
@@ -171,10 +172,14 @@ jobs:
171172
- "2.4"
172173
- "2.3" # lowest supported
173174
dependencies: [ "highest" ]
175+
exclude:
176+
- # incompatible combination
177+
php: "8.4"
178+
composer: "2.3"
174179
include:
175180
- # lowest supported
176181
php: "8.1"
177-
composer: "2.3"
182+
composer: "2.3.0"
178183
dependencies: "lowest"
179184
steps:
180185
- name: Checkout
@@ -184,7 +189,7 @@ jobs:
184189
# see https://github.com/shivammathur/setup-php
185190
uses: shivammathur/setup-php@v2
186191
with:
187-
php-version: ${{ env.PHP_VERSION_LATEST }}
192+
php-version: ${{ matrix.php }}
188193
extensions: ${{ env.PHP_PROJECT_EXT }}
189194
tools: composer:${{ matrix.composer }}
190195
coverage: none
@@ -197,10 +202,11 @@ jobs:
197202
uses: actions/cache@v4
198203
with:
199204
path: ${{ steps.composer-cache.outputs.dir }}
200-
key: composer-${{ github.job }}-${{ runner.os }}-php${{ matrix.php }}-${{ matrix.dependencies }}-${{ hashFiles('composer.*', 'tools/psalm/composer.*') }}
205+
key: composer-${{ github.job }}-${{ runner.os }}-php${{ matrix.php }}-c${{ matrix.composer }}-${{ matrix.dependencies }}-${{ hashFiles('composer.*', 'tools/psalm/composer.*') }}
201206
restore-keys: |
202-
composer-${{ github.job }}-${{ runner.os }}-php${{ matrix.php }}-${{ matrix.dependencies }}-
203-
composer-${{ github.job }}-${{ runner.os }}-php${{ matrix.php }}-
207+
composer-${{ github.job }}-${{ runner.os }}-p${{ matrix.php }}-c${{ matrix.composer }}-${{ matrix.dependencies }}-
208+
composer-${{ github.job }}-${{ runner.os }}-p${{ matrix.php }}-c${{ matrix.composer }}-
209+
composer-${{ github.job }}-${{ runner.os }}-p${{ matrix.php }}-
204210
composer-${{ github.job }}-${{ runner.os }}-
205211
- name: Install psalm
206212
run: composer install --no-interaction --no-progress --prefer-dist
@@ -210,7 +216,6 @@ jobs:
210216
# removing security-foo here is fine, as no code is run, only parsed
211217
composer remove --dev 'roave/security-advisories' \
212218
--no-update --no-install
213-
composer config platform.php ${{ matrix.php }}
214219
composer update \
215220
--no-interaction --no-progress \
216221
--prefer-dist \
@@ -321,7 +326,7 @@ jobs:
321326
# see https://github.com/shivammathur/setup-php
322327
uses: shivammathur/setup-php@v2
323328
with:
324-
php-version: ${{ env.PHP_VERSION_LATEST }}
329+
php-version: ${{ env.PHP_VERSION_LOWEST }}
325330
extensions: ${{ env.PHP_PROJECT_EXT }}
326331
tools: 'composer:v2'
327332
coverage: none
@@ -343,8 +348,7 @@ jobs:
343348
- name: Run PHP-CS-Fixer tests
344349
run: >
345350
php tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/php-cs-fixer
346-
fix
347-
--dry-run
351+
check
348352
--diff
349353
--using-cache=no
350354
--show-progress=dots

.php-cs-fixer.dist.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,18 @@
3333
* assistance via tool: https://mlocati.github.io/php-cs-fixer-configurator/
3434
*/
3535
[
36+
// region migrate
37+
// lowest supported PHP
38+
'@PHP80Migration:risky' => true, // there is no `PHP81Migration:risky`
3639
'@PHP81Migration' => true,
37-
'@PHP80Migration:risky' => true,
40+
// lowest supported Phpunit
3841
'@PHPUnit100Migration:risky' => true,
42+
// endregion migrate
43+
// region general code style
3944
'@Symfony' => true,
4045
'@Symfony:risky' => true,
46+
// endregion general code style
47+
// region customs
4148
'declare_strict_types' => true,
4249
'header_comment' => ['header' => $header],
4350
'global_namespace_import' => true,
@@ -48,6 +55,7 @@
4855
'psalm-suppress', // needed when PSALM introduced some issues that only manual hints can solve
4956
],
5057
],
58+
// endregion customs
5159
]
5260
)
5361
->setRiskyAllowed(true)

HISTORY.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@ All notable changes to this project will be documented in this file.
66

77
<!-- add unreleased items here -->
88

9+
* Added
10+
* Officially support PHP 8.4 ([#500] via [#522])
911
* Misc
1012
* Added`Override` markers where needed (via [#531])
1113
See also: <https://wiki.php.net/rfc/marking_overriden_methods>
1214

15+
[#500]: https://github.com/CycloneDX/cyclonedx-php-composer/issues/500
16+
[#522]: https://github.com/CycloneDX/cyclonedx-php-composer/pull/522
1317
[#531]: https://github.com/CycloneDX/cyclonedx-php-composer/pull/531
1418

1519
## 5.2.1 - 2025-01-27

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
"@php tools/composer-require-checker/vendor/maglnet/composer-require-checker/bin/composer-require-checker check"
106106
],
107107
"test:composer-unused": "@php tools/composer-unused/vendor/icanhazstring/composer-unused/bin/composer-unused --excludeDir=tools",
108-
"test:cs-fixer": "@php tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/php-cs-fixer fix --dry-run --diff",
108+
"test:cs-fixer": "@php tools/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/php-cs-fixer check --diff",
109109
"test:phpunit": "@php -d zend.assertions=1 -d assert.exception=1 -d display_errors=On -d error_reporting=-1 -d log_errors_max_len=0 -d memory_limit=-1 tools/phpunit/vendor/phpunit/phpunit/phpunit",
110110
"test:psalm": "@php tools/psalm/vendor/vimeo/psalm/psalm"
111111
},

0 commit comments

Comments
 (0)