Skip to content

chore: upgrade to PHP 8.5, apply Rector cleanup - #84

Open
kayjoosten wants to merge 6 commits into
mainfrom
chore/php85-docker-composer-npm-update
Open

chore: upgrade to PHP 8.5, apply Rector cleanup#84
kayjoosten wants to merge 6 commits into
mainfrom
chore/php85-docker-composer-npm-update

Conversation

@kayjoosten

Copy link
Copy Markdown

Closes #83

Bumps Docker base images, Composer dependencies, and Node/npm to PHP 8.5. Adds Rector (^2.4) with an 8.5-targeted rule set and applies its autofixes across bin/config/src/tests. Verified full DoD (composer install && composer check) in the real php85-apache2-node24 container.

The composer update to Symfony 7.4 (done in an earlier commit on this
branch) surfaced three failures that block a green test run. None of
these are related to the PHP 8.5 bump itself.

- symfony/console 7.4 deprecated Application::add() in favor of
  addCommand(). Three integration test setUp() methods called add()
  directly, which the deprecation listener treats as a hard failure.
  Switched all three call sites to addCommand().

- symfony/framework-bundle 7.3 deprecated leaving
  profiler.collect_serializer_data unset. Set it to true explicitly
  in framework.yaml.

- StopwatchTest slept for 1 second then asserted the elapsed time
  equals exactly 1000ms with zero tolerance. Real scheduler jitter
  (measured 2-12ms in this environment) made the assertion fail
  nondeterministically, most runs. Switched to assertEqualsWithDelta
  with a 50ms tolerance, well above the observed jitter but still
  tight enough to catch an actual regression.
Added rector/rector and a PHP 8.5 rule set, applied across bin,
config, src, and tests.

Rector's KernelTestCaseContainerPropertyDeprecationRule produced
invalid PHP in three integration test files: it rewrote an
assignment to self::getContainer(), a method call, instead of a
property. Skipped that rule and removed the cached static
$container property by hand, replacing every use site with a direct
self::$kernel->getContainer()->get(...) call, which returns the
same container instance within a booted test kernel.

The rector/rector version bump forced a phpstan 1.12 to 2.2 update
(and its symfony/deprecation-rules extension along with it), which
surfaced pre-existing findings unrelated to this change. Regenerated
the baseline with the repo's own phpstan-update-baseline script.
@kayjoosten
kayjoosten force-pushed the chore/php85-docker-composer-npm-update branch from 3d14717 to 8639e33 Compare August 24, 2026 14:01
config/reference.php is gitignored and generated locally by dumping
the bundle config reference. On a fresh checkout (real CI), the file
does not exist yet, and PHPStan's excludePaths rejects a path that
is neither a directory, file, nor fnmatch pattern, failing the whole
run before it starts. Mark the entry optional with the (?) suffix,
PHPStan's documented convention for exactly this case.
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.

Upgrade to PHP 8.5 and apply Rector cleanup

1 participant