Repository navigation
Upgrade to PHP 8.5 and apply Rector cleanup - #675
Open
kayjoosten wants to merge 8 commits into
Open
kayjoosten wants to merge 8 commits into
kayjoosten wants to merge 8 commits into
Conversation
kayjoosten
force-pushed
the
feature/issue-634-php85-upgrade
branch
3 times, most recently
from
October 22, 2026 13:05
84fc897 to
bc11bc4
Compare
If applied, this commit will raise the minimum and CI PHP version to 8.5, update dependencies to versions compatible with it, and apply Rector's PHP 8.5 rule set across the codebase. Why is this change needed? Prior to this change, the application was pinned to PHP 8.2 in composer.json, the Docker base images, CI workflows and Scrutinizer config. PHP 8.2 is approaching end of life and the project needs to move to a currently supported version. How does it address the issue? This change: - Raises the composer.json PHP constraint and platform override to ^8.5, and bumps rector/rector to ^2.4 - Switches the production and test Dockerfiles, the local compose override and the CI build-and-publish workflow to the php85-apache2-node24 base image - Updates .scrutinizer.yml to use PHP 8.5 and Node v24 - Enables Rector's PHP version sets in ci/qa/rector.php and runs Rector against src/ and bin/, applying constructor property promotion, readonly properties/classes and other PHP 8.5 idioms - Skips Rector's GetToConstructorInjectionRector, which assumes autowired controllers; this codebase relies on container-aware controllers resolving services through $this->get() and a service locator, so applying that rule broke the compiled DI container - Reformats the constructors Rector collapsed onto a single line so they comply with the project's line-length and multi-line declaration coding standards - Updates composer.lock and symfony.lock via composer update Provide links to any relevant tickets, articles or other resources #634
Prior to this change, many classes, attributes and docblock types were referenced by their fully qualified name inline, which hurts readability. This change enables Rector's import names option, applies it across the code base, and aliases the one import that clashes with a local class. Generated config files are skipped.
Prior to this change, the PR carried a regenerated config/reference.php, a recipe-generated open_conext_monitor.yaml, and a Rector rewrite that moved the ORM column of InstitutionConfiguration into a mixed promoted constructor parameter. This change restores the generated files from main, restores the explicit property declaration, and tells Rector not to apply constructor promotion to Doctrine entities.
Prior to this change, the PR added a retry loop around the functional Behat suite that is unrelated to the PHP 8.5 upgrade and can hide real failures, and Rector left the imports it added unsorted. This change restores ci/qa/behat-functional from main, sorts all use statements alphabetically, and enables the Slevomat AlphabeticallySortedUses sniff in the PHPCS ruleset.
Prior to this change, Rector had added string casts, deprecation attributes on unused test logger methods, and the lock file listed a recipe for a package whose config file does not exist. This change skips NullToStrictStringFuncCallArgRector, reverts the casts it added (the array_key_exists cast is kept because another rule requires it), drops #[\Deprecated] from the test logger, and removes the orphan nyholm/psr7 entry from symfony.lock.
johanib
force-pushed
the
feature/issue-634-php85-upgrade
branch
from
November 19, 2026 09:49
6e0e60e to
01a2259
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If applied, this commit will...
Raise the minimum and CI PHP version to 8.5, update Composer dependencies to versions compatible with it, and apply Rector's PHP 8.5 rule set across the codebase.
Why is this change needed?
Prior to this change, the project targeted PHP 8.2 and had not adopted newer language features available since, leaving code more verbose than it needs to be and falling behind the PHP version used by sibling projects.
How does it address the issue?
This change bumps the
composer.jsonPHP constraint to^8.5, updates the Docker images, CI workflow, and Scrutinizer config to PHP 8.5 with Node 24, addsrector/rector: ^2.4with arector.phpconfig matching the one proposed in the issue, and applies Rector acrosssrc,tests,config, andbin. Constructor property promotion, readonly properties/classes,matchexpressions,str_contains()/str_starts_with(),::classconstants, and other PHP 8+ idioms were adopted throughout. One Rector rule (GetToConstructorInjectionRector) was skipped because it breaks this codebase's controllers, which rely on$this->get()service lookups rather than constructor autowiring. The full QA suite (phplint, phpstan, phpcs, phpmd, license headers, PHPUnit, Behat, ESLint, Encore build) passes on PHP 8.5.Provide links to any relevant tickets, articles or other resources
Closes #634