Skip to content

Prepare 2.0: PHP 8.2+, PHPUnit 11.5+, PHPStan 2 at max level - #3

Merged
mnapoli merged 1 commit into
mainfrom
prepare-v2
Sep 26, 2026
Merged

mnapoli merged 1 commit into
mainfrom
prepare-v2

Conversation

@mnapoli

@mnapoli mnapoli commented Sep 26, 2026

Copy link
Copy Markdown
Member

Cleanup for the 2.0 major, after #2.

  • PHP 8.2+ (was 8.0+). Monolog ^2.4|^3 is unchanged: apps on Monolog 2 (e.g. Symfony 5.4) keep working.
  • Dev dependencies: PHPUnit ^11.5|^12|^13 (11.5 is the first to require PHP 8.2), PHPStan ^2.
  • PHPStan at level max (was 5). Monolog 2 records (arrays) and Monolog 3 records (LogRecord) are now read in one place, fields(), with a typed shape, instead of $record['level_name'] ?? $record['level']['name'] everywhere. formatBatch() declared its parameter as a single record rather than an array of records.
  • CI: PHP 8.2 to 8.5, --prefer-lowest on 8.2 (which tests Monolog 2.4 and PHPUnit 11.5), phpcs now runs (the "Coding standards" job only ran PHPStan, which is how an unused import landed on main), actions/checkout@v7 and actions/cache@v6, no more deprecated --no-suggest, cache key on composer.json since there is no lock file.
  • phpstan.neon is excluded from the package archive.
  • README: the Laravel and Symfony bridges set this formatter by default; the Symfony example uses the bref.cloudwatch_formatter service registered by BrefBundle (the class name only works if the app registers it as a service) and logs to php://stderr rather than to a file.

Behavior: unchanged, except that closed resources in the context are now normalized by Monolog ([unknown(resource (closed))]) instead of being passed as-is to json_encode(). Level names were already uppercase in Monolog 2 and 3, so strtoupper() is gone.

Tested locally with the latest dependencies (Monolog 3.12, PHPUnit 13) and the lowest ones (Monolog 2.4, PHPUnit 11.5).

@mnapoli
mnapoli merged commit ffde346 into main Sep 26, 2026
6 checks passed
@mnapoli
mnapoli deleted the prepare-v2 branch September 26, 2026 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant