Skip to content

fix: PHP 8.4 nullable deprecations + modernise CI matrix - #9

Merged
mwansinck merged 4 commits into
v3.0from
fix/php84-implicit-nullable-params
Jun 16, 2026
Merged

fix: PHP 8.4 nullable deprecations + modernise CI matrix#9
mwansinck merged 4 commits into
v3.0from
fix/php84-implicit-nullable-params

Conversation

@mwansinck

@mwansinck mwansinck commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Targets the v3.0 branch.

1. Explicit nullable types (PHP 8.4 deprecations)

PHP 8.4 deprecates implicitly nullable parameters (a typed parameter whose default is null). Made explicit with ?type:

Implicitly marking parameter $x as nullable is deprecated, the explicit nullable type must be used instead

File Parameters
src/Serializer/Normalizer/TimeWindowNormalizer.php $format ×2
src/Serializer/Normalizer/LocationNormalizer.php $format ×4
src/Serializer/Normalizer/ArrivalNormalizer.php $format ×2
src/Connection.php $uri (constructor)

The 8 normalizer locations are the ones surfaced in MKO-1330; Connection::__construct had the same pattern and is fixed too. No behavioural change.

2. Supported-version policy + CI matrix

Supported Symfony lines are now LTS + current only:

^6.4 (LTS) | ^7.4 (LTS) | ^8.0 (current)
  • Added Symfony 8 (|^8.0)
  • Dropped EOL Symfony 7.0–7.3 (narrowed ^7.0^7.4)

CI matrix replaced (was PHP 7.4–8.1 × Symfony 5.4/6.0, none supported) and now exercises the full declared range:

Symfony PHP
6.4 8.2, 8.3, 8.4, 8.5
7.4 8.2, 8.3, 8.4, 8.5
8.0 8.4, 8.5
8.1 8.4, 8.5

(Symfony 8.x requires PHP ≥ 8.4.)

Supporting CI changes: php-cs-fixer job 8.1 → 8.2; actions/checkout@v2@v4, actions/cache@v2@v4; removed ::set-output$GITHUB_OUTPUT; activate symfony/flex and use composer update (no lock committed).

Semver note

Narrowing ^7.0^7.4 drops (EOL) 7.1–7.3, so this is not purely additive — suggest releasing as a minor (3.1.0) rather than a 3.0.1 patch.

Verification (local, PHP 8.5)

  • phpunit: 3/3 pass on Symfony 6.4.37, 7.4.10 and 8.1.0, no PHP implicit-nullable deprecations
  • phpstan: no errors · php-cs-fixer --dry-run: 0 files · php -l: clean · composer validate: valid

Ref: MKO-1330

PHP 8.4 deprecates implicitly nullable parameters (a typed param with a
null default). Make the nullability explicit with ?type in the serializer
normalizers and Connection, removing the deprecation warnings:

  Implicitly marking parameter $x as nullable is deprecated, the explicit
  nullable type must be used instead

- TimeWindowNormalizer, LocationNormalizer, ArrivalNormalizer: $format
- Connection: $uri

No behavioural change; tests, PHPStan and PHP-CS-Fixer stay green.
@mwansinck
mwansinck requested a review from rvmourik June 16, 2026 13:51
The matrix tested PHP 7.4-8.1 against Symfony 5.4/6.0, all of which the
package no longer supports (composer.json already requires PHP ^8.2 and
Symfony ^6.4|^7.0). Replace it with the currently supported range:

  - Symfony 7.4: PHP 8.2, 8.3, 8.4, 8.5
  - Symfony 8.0/8.1: PHP 8.4, 8.5 (Symfony 8.x requires PHP >= 8.4)

Also:
- Allow Symfony 8 in composer.json (additive |^8.0, no BC break)
- Bump php-cs-fixer job to PHP 8.2 (the supported floor)
- actions/checkout@v2 -> v4, actions/cache@v4
- Replace removed ::set-output with $GITHUB_OUTPUT
- Activate the symfony/flex plugin and use 'composer update' (no lock is committed)

Verified locally: Symfony 7.4.10 and 8.1.0 both green (phpunit 3/3).
@mwansinck mwansinck changed the title fix: explicit nullable types for PHP 8.4 deprecations fix: PHP 8.4 nullable deprecations + modernise CI matrix Jun 16, 2026
Symfony 7.0-7.3 are out of maintenance; 7.4 is the LTS on the 7.x line.
Narrow the constraint from ^7.0 to ^7.4 (6.4 LTS and 8.x kept).

Constraints are now: ^6.4 (LTS) | ^7.4 (LTS) | ^8.0 (current).
This matches the CI matrix, which already targets 7.4/8.0/8.1.
composer.json supports ^6.4 but CI did not exercise it. Add Symfony 6.4
across PHP 8.2-8.5 (6.4 supports PHP 8.1+; package floor is 8.2), closing
the gap between the declared and tested support range.

Verified locally: Symfony 6.4.37 green (phpunit 3/3).
@mwansinck
mwansinck merged commit 84be0c4 into v3.0 Jun 16, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants