Drop support for PHP < 8.1#361
Merged
Merged
Conversation
6309d14 to
4574d87
Compare
- Bump PHP requirement to ^8.1 in composer.json - Update phpVersion to 80100 in phpstan.neon.dist and phpcs.xml.dist - Drop PHP 7.4 / 8.0 from CI test matrix - Promote constructor parameters to private readonly across rules - Convert switch ($node::class) to match expressions - str_contains / str_ends_with for legacy strpos / substr_compare - First-class callable syntax in ForbidCheckedExceptionInCallableRule - Drop PHP_VERSION_ID < 80100 guards in tests that are now always satisfied - Replace get_class() with ::class in tests - Enable enforceClosureParamNativeTypehint (no longer needed PHP 7.4 escape) - Remove obsolete BackedEnum / isEnum() BC ignores from phpstan.neon.dist - Drop coverage-guard removal workaround in CI (it requires PHP 8.1+)
4574d87 to
d3aefe6
Compare
Merged
2 tasks
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.
Summary
^8.1(composer.json, phpstan/phpcsphpVersion, CI matrix).Config changes
composer.json:"php": "^7.4 || ^8.0"→"^8.1"phpstan.neon.dist:phpVersion.min: 70400→80100; enableenforceClosureParamNativeTypehint; drop obsolete BC ignores (BackedEnum not found,isEnum() always false)phpcs.xml.dist:php_version: 70400→80100; dropDisallowTrailingCommaInDeclarationoverride (trailing commas are now required by the default coding standard).github/workflows/checks.yml: drop7.4/8.0from test matrix; remove thecomposer remove shipmonk/coverage-guardworkaround (it requires PHP 8.1+ — same as us now)Source modernization
private readonlyacross rules (skipped where the constructor has mixed responsibilities, e.g.ForbidCustomFunctionsRulevalidates and transforms its input)switch (\$node::class)→matchexpressions (ForbidMethodCallOnMixedRule,ForbidFetchOnMixedRule,ForbidIncrementDecrementOnNonIntegerRule)strpos(...) !== false→str_contains(...)(ForbidCheckedExceptionInCallableRule)substr_compare(\$a, \$b, -strlen(\$b)) === 0→str_ends_with(\$a, \$b)(ClassSuffixNamingRule)\$this->normalizeArgumentIndexes(...)inForbidCheckedExceptionInCallableRulephpcbfadded trailing commas to all multi-line function declarations (now required)Test modernization
PHP_VERSION_ID < 80100/< 80000guards that are now always satisfied (kept< 80200and< 80400checks that are still relevant)get_class(\$x)→\$x::classinAllRulesInConfigTestTest plan
composer checkpasses (composer normalize, phpcs, phpstan, phpunit, coverage-guard, dependency-analyser, name-collision-detector, inline-ignore verifier)