Skip to content

Major upgrades: PHPStan 2, Rector 2 (+ working config), monolog/migrations/predis (#538)#548

Open
maltehuebner wants to merge 2 commits into
mainfrom
upgrade/major-deps-538
Open

Major upgrades: PHPStan 2, Rector 2 (+ working config), monolog/migrations/predis (#538)#548
maltehuebner wants to merge 2 commits into
mainfrom
upgrade/major-deps-538

Conversation

@maltehuebner

Copy link
Copy Markdown
Contributor

Works through the verifiable subset of #538. Several items in the issue were already done on main and are noted below.

Changes

Dev toolchain (fully CI-verifiable)

  • PHPStan 1.12 → 2.2.5 and Rector 1.2 → 2.5.6 (upgraded together — rector 1.2 pins phpstan ^1.12 and rector 2 requires phpstan ^2, so they are inseparable). The existing 86-entry phpstan-baseline.neon is already compatible with PHPStan 2 (analyse reports no un-baselined errors), so it is kept as-is; level stays 5.
  • rector.php fixed. It previously called ->sets([]) (empty) — Rector was installed but did nothing. Rewritten with the v2 fluent API (withPhpSets() + deadCode/codeQuality/typeDeclarations prepared sets). Config validated with rector process --dry-run (reports 44 files it would change). The mass code rewrite is intentionally not applied in this PR — this commit only makes the tool functional; running it is a separate reviewable change.

Runtime dependency bumps (separate commits, see caveat)

  • symfony/monolog-bundle 3.11 → 4.0.2
  • doctrine/doctrine-migrations-bundle 3.7 → 4.0.0
  • predis/predis 2.4 → 3.5.1 (only the fallback driver behind Symfony's RedisAdapter; ext-redis takes precedence in prod)

Each is an isolated single-package update whose configuration surface uses keys unchanged across the major version.

Already done on main (issue was written against an older state)

Deliberately not implemented / deferred

  • PHPUnit 12 → 13. Blocked by a doctrine/deprecations conflict (doctrine/deprecations 1.1.5 conflicts with phpunit/phpunit 13.x). Since the suite is already on a modern, CVE-free 12.x, this low-value bump is left until doctrine/deprecations gains phpunit-13 support.
  • PHPStan level ≥ 6 and baseline burn-down. Depends on the bug-fix issues ([Hoch] Mass Assignment im EntityMerger + wirkungsloser #[Ignore]-Check #523 etc., owned separately). Raising the level would add new errors requiring either fixes or baseline growth; kept at level 5 to land a clean, green upgrade.
  • Applying Rector's suggested rewrites (44 files). Out of scope for a tooling-upgrade PR; should be its own reviewable diff.
  • npm majors (Encore 6, DataTables 2, leaflet-extra-markers 2). These need a runnable npm run build plus Chart.js v2→v4 axis-API rewrites (History.js) to verify; not verifiable in this environment. Left for a dedicated frontend PR.

Verification (with the local vendor/)

  • vendor/bin/phpstan analyse --no-progress — No errors (PHPStan 2)
  • vendor/bin/phpunit --testsuite="Project Test Suite" — OK (121 tests)
  • vendor/bin/rector process --dry-run — config loads and runs
  • Limitation: the Symfony container could not be booted here (local vendor/ lacks symfony/runtime, so bin/console/WebTestCase do not start), so the monolog/migrations/predis bundle config parsing and DI wiring were not runtime-verified. Each runtime bump is a separate commit for easy isolation.

Refs #538 (partial)

🤖 Generated with Claude Code

maltehuebner and others added 2 commits July 13, 2026 16:30
…onfig

PHPStan and Rector are coupled: rector 1.2 pins phpstan ^1.12 and
rector 2.x requires phpstan ^2.x, so both are bumped together.

- phpstan/phpstan ^1.12 -> ^2.0 (2.2.5). The existing 86-entry
  phpstan-baseline.neon is already compatible with PHPStan 2 (analyse
  reports no un-baselined errors), so the baseline is kept as-is to
  avoid churn; burning it down further is left to the bug-fix issues.
  Level stays at 5 for now.
- rector/rector ^1.2 -> ^2.0 (2.5.6).
- rector.php previously configured `->sets([])` (empty) so Rector did
  nothing. Rewritten with the v2 fluent API to apply withPhpSets() plus
  the deadCode/codeQuality/typeDeclarations prepared sets. The actual
  code rewrites (44 files in --dry-run) are intentionally NOT applied
  here; this commit only makes the tool functional.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Individual major bumps that each resolve as an isolated single-package
update:

- symfony/monolog-bundle ^3.0 -> ^4.0 (4.0.2). The configured handlers
  (stream, console, fingers_crossed, loggly, deprecation) use config
  keys unchanged in v4.
- doctrine/doctrine-migrations-bundle ^3.1 -> ^4.0 (4.0.0). The config
  keys in use (migrations_paths, enable_profiler, storage.table_storage)
  are all still valid in v4; the migrations directory is currently empty.
- predis/predis ^2.0 -> ^3.0 (3.5.1). Used only as the fallback driver
  behind Symfony's RedisAdapter::createConnection (ext-redis takes
  precedence when present); symfony/cache resolves cleanly against v3.

Verified via composer resolution + PHPStan + the unit test suite. The
container could not be booted in this environment (local vendor lacks
symfony/runtime), so bundle config parsing / DI wiring was not runtime-
verified; each bump is a separate commit for easy isolation if needed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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