Refactor PHP compatibility and update dependencies for PHP 8.3+#184
Conversation
|
Thanks for the approval @andytson-inviqa |
normally something that's not a bugfix would be a new minor release (so 0.5.0 with a 0.5.x branch target forked from 0.4.x) deprecation fixes can be bugfix, but the composer changes and min PHP version change I'd be more inclined to new minor release |
|
so in this case we:
is this the way you have done it before? or have you followed a different approach? |
If you have the access needed, you can do it, and yes that's the steps. But also include setting github default branch to 0.5.x for future PRs |
|
@andytson-inviqa now that I switched the base for the PR it requires a new review. |
PHP 8.3+ Compatibility and Dependency Refresh
Summary
This PR makes PHP 8.3 the explicit minimum supported version and refreshes the
runtime/build dependencies needed to keep Workspace quiet and buildable on
current PHP releases.
PHP Requirement and Builders
The Composer PHP constraint is raised from
^8.1to^8.3. The local Dockerbuilders now match that supported range:
builder83,builder84, andbuilder85are kept, while the PHP 8.1 and PHP 8.2 builders are removed.The active release/build path already targets PHP 8.3+, so keeping PHP 8.1/8.2
constraints would make the patch larger and block the dependency updates needed
for newer PHP compatibility.
Symfony Runtime Dependencies
The direct Symfony runtime dependencies now target Symfony 7.4.
Symfony 7.4 supports PHP 8.3 and avoids the PHP 8.4 implicit-nullability
deprecations seen in the previously locked Symfony packages. Symfony 8 is not
used because it would raise the PHP minimum beyond 8.3.
Reflection Access
The branch removes repeated calls to:
PHP has ignored this call since 8.1, and PHP 8.5 deprecates it. The surrounding
factory style is otherwise unchanged: the code still caches
ReflectionPropertyinstances and sets values the same way as before.PHAR Build Tooling
vendor-bin/php-box/composer.jsonnow requireshumbug/box^4.7.Box 4.7 is compatible with the PHP 8.3 floor and avoids older PHAR build
warnings/failures on newer PHP versions. The deprecated Box
metadatasettingis also removed from
box.json; Workspace already reports its CLI version fromhome/build, so the PHAR metadata is not needed for normalws versionoutput.
The explicit
bamarni-binsettings preserve the existing isolated Box installbehavior after the plugin upgrade:
vendor/bin/boxis still created fortools/scripts/compile.sh, and Composer bin commands keep the currentforwarding behavior.
Development Tooling
Development tooling is refreshed where it does not require a broader migration:
friendsofphp/php-cs-fixeris updated within the current 3.x line, and themechanical fixes required by the existing config are applied.
Formatter-only changes were applied in:
packages/Console/src/Application/Executor.phppackages/Console/src/Application/Plugin/VersionInfoPlugin.phppackages/FSM/src/Definition.phppackages/FSM/src/Runner/SequenceRunner.phppackages/FSM/src/Runner/StepRunner.phppackages/FSM/src/State/DefaultState.phppackages/FSM/src/Transition/DefinitionTransitionBuilder.phpphpstan/phpstanis updated within the current 2.x line.phpunit/phpunitis updated to 9.6.PHPUnit is intentionally kept on 9.6 because PHPUnit 11/12 require a separate
migration away from docblock-based tests and non-static data providers. Composer
therefore still reports abandoned Sebastian packages during install; removing
that notice belongs with the PHPUnit migration, not this compatibility patch.
Documentation
The builder list is reduced to the supported PHP 8.3/8.4/8.5 builders,
and the download example now points at the 0.4.x release line
(but it should be updated to the actual future 4.x.x release once that is available).
Compatibility
This branch supports PHP 8.3 and newer:
That means PHP 8.1 and PHP 8.2 are no longer supported by this branch. The
smallest clean patch under a PHP 8.3 floor is smaller than the earlier
PHP 8.1-compatible variant because it can use newer Symfony, PHPUnit, Box, and
supporting tooling directly.
Known Non-Goals
This PR does not target PHP 8.0, 8.1, or 8.2 compatibility, and it does not
attempt to move to dependency lines that require PHP newer than 8.3.
This PR also does not migrate the test suite to modern PHPUnit attributes.
Composer still reports abandoned Sebastian packages from PHPUnit 9.6 during
composer install; removing that notice requires the PHPUnit 11/12 migrationdescribed above.
Validation
composer validate --strictcomposer why-not php 8.3.0 --lockedcomposer --working-dir=vendor-bin/php-box why-not php 8.3.0 --lockedphp -d memory_limit=1G vendor/bin/phpstan analysevendor/bin/php-cs-fixer fix --dry-run --diff --verbosedocker compose configmarkdownlint README.md docs/php-compatibility-pr-notes.mdgit diff --checkbuilder83: PHP 8.3.31,/app/build.sh, 183 tests / 302 assertionsbuilder84: PHP 8.4.21,/app/build.sh, 183 tests / 302 assertionsbuilder85: PHP 8.5.6,/app/build.sh, 183 tests / 302 assertionsBox 4.7 reports
No warning found.during PHAR compilation on all threebuilders, and no PHP deprecation output was observed during the builder runs.