-
-
Notifications
You must be signed in to change notification settings - Fork 47
PHP 7 deprecation #550
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
fain182
wants to merge
10
commits into
main
Choose a base branch
from
claude/php7-deprecation-analysis-z2PjX
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
PHP 7 deprecation #550
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
This commit removes support for PHP 7.4 and sets the minimum required PHP version to 8.0, enabling the use of modern PHP features and simplifying dependency management. Changes: - Update composer.json to require PHP ^8.0 - Remove symfony/polyfill-php80 dependency (native in PHP 8.0+) - Update Symfony components from ^3.0-8.0 to ^6.0-8.0 - Update phpstan/phpdoc-parser from ^1.2|^2.0 to ^2.0 - Update PHPUnit from ^7.5|^9.0|^10.0 to ^9.6|^10.0|^11.0 - Remove PHP 7.4 from CI test matrix (.github/workflows/build.yml) - Update default Dockerfile PHP version from 7.4 to 8.0 - Remove PHP_7_4 constant from TargetPhpVersion class - Update all tests to use PHP 8.0 as default version - Update README.md to reflect supported PHP versions Benefits: - Enables future use of PHP 8.0+ features (constructor property promotion, match expressions, named arguments, union types, etc.) - Removes support for 3 major Symfony versions (3.x, 4.x, 5.x) - Reduces dependency footprint by removing polyfill - Simplifies testing matrix and maintenance
PHP-CS-Fixer requires trailing commas in multi-line function parameters for consistency with PHP 8.0+ coding standards. Files updated: - src/Analyzer/ClassDescription.php - src/Analyzer/FileParser.php - src/CLI/Runner.php - src/PHPUnit/ArchRuleCheckerConstraintAdapter.php - src/Rules/ArchRule.php - tests/E2E/Cli/CheckCommandTest.php
The current psalm.phar version doesn't support PHP 8.4+. Running static analysis on PHP 8.3 ensures compatibility with the current Psalm binary while still testing against a modern PHP version. This is a temporary solution until psalm.phar is updated to version 7.0+ which supports PHP 8.4 and 8.5.
Run static analysis on PHP 8.0 to maintain consistency with: - Coding standard checks (PHP 8.0) - Code coverage (PHP 8.0) - Phar build (PHP 8.0) The current psalm.phar supports PHP 8.0-8.3, so running on 8.0 works correctly and keeps all quality checks on the same PHP version.
Symfony 6.4+ requires PHP 8.1, so we constrain Symfony components to: - Symfony 5.4.x (PHP >= 7.2.5) - Symfony 6.0-6.3 (PHP >= 8.0.2) This maintains PHP 8.0 support while avoiding dependency conflicts. Updated constraints: - symfony/console: ^5.4 || ^6.0 <6.4 - symfony/event-dispatcher: ^5.4 || ^6.0 <6.4 - symfony/finder: ^5.4 || ^6.0 <6.4 - symfony/var-dumper: ^5.4 || ^6.0 <6.4 Note: In a future PR, upgrading to PHP 8.1 will unlock Symfony 6.4 LTS (supported until November 2027) and enable modern PHP features like enums and readonly properties.
Add coverage driver configuration to setup-php action to enable code coverage collection with PCOV. This fixes the PHPUnit warning: 'No filter is configured, code coverage will not be processed' The coverage driver is configured via matrix strategy (pcov) and now properly passed to setup-php action.
Split test step into two separate steps: - 'Test with coverage' runs only on PHP 8.0 with --coverage-clover - 'Test without coverage' runs on all other versions without coverage This fixes the PHPUnit warning on PHP 8.2+ where PCOV configuration may not be properly set up, and also improves CI performance by only generating coverage once instead of on all 6 PHP versions. Fixes: No filter is configured, code coverage will not be processed
The coverage-driver matrix variable had only one value (pcov), making it unnecessary. Simplified by: - Removing coverage-driver from matrix strategy - Hardcoding coverage: pcov in setup-php action This makes the configuration clearer without changing functionality.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #550 +/- ##
============================================
- Coverage 97.75% 97.69% -0.07%
- Complexity 616 621 +5
============================================
Files 80 80
Lines 1779 1775 -4
============================================
- Hits 1739 1734 -5
- Misses 40 41 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Changed from @PHP71Migration:risky to @PHP80Migration:risky to enable PHP 8.0+ coding standards and modernizations. This automatically converts traditional closures to arrow functions where applicable, resulting in cleaner, more concise code. Changes applied: - Updated .php-cs-fixer.dist.php configuration - Converted 7 closures to arrow functions (fn) - Removed outdated PHP 7.3 compatibility comment Benefits: - 20 lines of code removed - More modern PHP 8.0+ syntax - Better alignment with minimum PHP version requirement
Update Scrutinizer CI environment from PHP 7.4 to PHP 8.0 to match the new minimum PHP version requirement. This ensures code quality analysis runs on the correct PHP version.
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.
No description provided.