Repository navigation
Support PHP 7.4+ via native source downgrade - #96
Merged
Merged
Conversation
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.
Lower the minimum PHP from 8.4 to 7.4, so the package can run on legacy projects. The source is natively downgraded (the same approach as rectorphp/swiss-knife#153), no PHAR/scoper build.
Source downgrade (src + packages/type-perfect/src)
Produced with Rector downgrade sets (
withDowngradeSets(php74: true)), then committed:readonlyproperties/classes to@readonlydocblocksstr_contains()rewritten tostrpos()rector.phpkeepswithPhpSets(), which now resolves to 7.4 fromcomposer.json, so the source stays at this level.composer.json
require.php:^8.4to>=7.4(phpstan/phpstan ^2.2andwebmozart/assert ^1.11both support 7.4)Self type-coverage thresholds (phpstan.neon)
The package measures its own type coverage. On 7.4, native union types and typed constants are impossible, so the strict thresholds are no longer reachable:
return_type99.9 to 96,param_type100 to 99,constant_type100 to 0smaller.alwaysFalseignore (thePHP_VERSION_ID < 80300guards are real branches now, not always-false)CI
bare_run.yaml: lints the source and installs prod deps on PHP 7.4, 8.2, 8.5various_php_install.yaml(its 7.2 target is below the new minimum;bare_runvalidates the actual branch source instead)Docs
Checks pass locally: PHPStan, ECS, Rector (stable at 7.4), composer-dependency-analyser, 88 tests.