Skip to content

Commit 8fc71f9

Browse files
committed
PHP 8.4 compatibility
- Allow PHP 8.4 - Fix `Implicitly marking parameter $param as nullable is deprecated` - Replace E_USER_ERROR errors by exceptions - Update/patch dependencies to get PHP 8.4 compatibility
1 parent c74bad8 commit 8fc71f9

31 files changed

+989
-147
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
include:
3737
- {php-version: "8.2"} # Lint on lower PHP version to detected too early usage of new syntaxes
3838
- {php-version: "8.3"} # Lint on higher PHP version to detected deprecated elements usage
39+
- {php-version: "8.4-rc"}
3940
env:
4041
COMPOSE_FILE: ".github/actions/docker-compose-app.yml"
4142
APPLICATION_ROOT: "${{ github.workspace }}"
@@ -73,9 +74,11 @@ jobs:
7374
run: |
7475
.github/actions/init_show-versions.sh
7576
- name: "Force used PHP version"
77+
# Strip the stability suffix (e.g. "8.4-rc" -> "php:>=8.4")
7678
run: |
79+
REQUIRED_PHP_VERSION="$(echo "${{ matrix.php-version }}" | cut -d '-' -f 1)"
7780
docker compose exec -T app composer config --unset platform.php
78-
docker compose exec -T app composer require "php:>=${{ matrix.php-version }}" --ignore-platform-req=php+ --no-install --no-scripts
81+
docker compose exec -T app composer require "php:>=$REQUIRED_PHP_VERSION" --ignore-platform-req=php+ --no-install --no-scripts
7982
- name: "Build dependencies / translations"
8083
run: |
8184
docker compose exec -T app .github/actions/init_build.sh
@@ -115,6 +118,7 @@ jobs:
115118
MATRIX='
116119
{
117120
"include": [
121+
{"php-version": "8.4-rc", "db-image": "mariadb:11.4"},
118122
{"php-version": "8.3", "db-image": "mariadb:11.4"},
119123
{"php-version": "8.3", "db-image": "mysql:8.4"},
120124
{"php-version": "8.2", "db-image": "mariadb:11.4"},
@@ -127,6 +131,7 @@ jobs:
127131
MATRIX='
128132
{
129133
"include": [
134+
{"php-version": "8.4-rc", "db-image": "mariadb:11.4"},
130135
{"php-version": "8.3", "db-image": "mariadb:11.4"},
131136
{"php-version": "8.3", "db-image": "mysql:8.4"}
132137
]

composer.json

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"league/oauth2-server": "^9.0",
5252
"mexitek/phpcolors": "^1.0",
5353
"monolog/monolog": "^3.7",
54-
"paragonie/sodium_compat": "^2.0",
54+
"paragonie/sodium_compat": "^2.1",
5555
"phpdocumentor/reflection-docblock": "^5.4",
5656
"phpoffice/phpspreadsheet": "^2.2",
5757
"psr/cache": "^3.0",
@@ -99,8 +99,8 @@
9999
},
100100
"require-dev": {
101101
"ext-xml": "*",
102-
"atoum/atoum": "^4.2",
103-
"atoum/stubs": "^2.6",
102+
"atoum/atoum": "dev-main#e43a6a84809635cf5dcdf80bf3c773e7cf1d5a04",
103+
"atoum/stubs": "dev-master#fb8890f347a7ecf1e3cf2b5a139a8b038359a6ab",
104104
"friendsoftwig/twigcs": "^6.4",
105105
"glpi-project/tools": "^0.7",
106106
"mikey179/vfsstream": "^1.6",
@@ -182,19 +182,31 @@
182182
"post-install-cmd": [
183183
"@php -r \"file_put_contents('.composer.hash', sha1_file('composer.lock'));\"",
184184
"@php -f vendor/bin/build_hw_jsons",
185-
"patch -f -p1 -d vendor/laminas/laminas-mail/ < tools/patches/laminas-mail-invalid-header-ignore.patch || true",
186-
"patch -f -p1 -d vendor/laminas/laminas-mail/ < tools/patches/laminas-mail-address-no-length-check.patch || true",
187-
"patch -f -p1 -d vendor/guzzlehttp/guzzle/ < tools/patches/guzzle-http-client-restrict-http-methods.patch || true"
185+
"@patch"
188186
],
189187
"post-update-cmd": [
190188
"@php -r \"file_put_contents('.composer.hash', sha1_file('composer.lock'));\"",
191189
"@php -f vendor/bin/build_hw_jsons",
192-
"patch -f -p1 -d vendor/laminas/laminas-mail/ < tools/patches/laminas-mail-invalid-header-ignore.patch || true",
193-
"patch -f -p1 -d vendor/laminas/laminas-mail/ < tools/patches/laminas-mail-address-no-length-check.patch || true",
194-
"patch -f -p1 -d vendor/guzzlehttp/guzzle/ < tools/patches/guzzle-http-client-restrict-http-methods.patch || true"
190+
"@patch"
195191
],
196192
"build": [
197193
"bin/console dependencies install && bin/console locales:compile"
194+
],
195+
"patch": [
196+
"patch -f -p1 -d vendor/laminas/laminas-mail/ < tools/patches/laminas-mail-invalid-header-ignore.patch || true",
197+
"patch -f -p1 -d vendor/laminas/laminas-mail/ < tools/patches/laminas-mail-address-no-length-check.patch || true",
198+
"patch -f -p1 -d vendor/guzzlehttp/guzzle/ < tools/patches/guzzle-http-client-restrict-http-methods.patch || true",
199+
"patch -f -p1 -d vendor/apereo/phpcas/ < tools/patches/apereo-phpcas-php84.patch || true",
200+
"patch -f -p1 -d vendor/friendsoftwig/twigcs/ < tools/patches/friendsoftwig-twigcs-php84.patch || true",
201+
"patch -f -p1 -d vendor/league/event/ < tools/patches/league-event-php84.patch || true",
202+
"patch -f -p1 -d vendor/league/oauth2-client/ < tools/patches/league-oauth2-client-php84.patch || true",
203+
"patch -f -p1 -d vendor/league/oauth2-server/ < tools/patches/league-oauth2-server-php84.patch || true",
204+
"patch -f -p1 -d vendor/sabre/dav/ < tools/patches/sabre-dav-php84.patch || true",
205+
"patch -f -p1 -d vendor/sabre/vobject/ < tools/patches/sabre-vobject-php84.patch || true",
206+
"patch -f -p1 -d vendor/swaggest/json-diff/ < tools/patches/swaggest-json-diff-php84.patch || true",
207+
"patch -f -p1 -d vendor/swaggest/json-schema/ < tools/patches/swaggest-json-schema-php84.patch || true",
208+
"patch -f -p1 -d vendor/symfony/cache/ < tools/patches/symfony-cache-php84.patch || true",
209+
"patch -f -p1 -d vendor/wapmorgan/unified-archive/ < tools/patches/wapmorgan-unified-archive-php84.patch || true"
198210
]
199211
}
200212
}

0 commit comments

Comments
 (0)