Skip to content

Conversation

@fain182
Copy link
Collaborator

@fain182 fain182 commented Dec 20, 2025

No description provided.

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
Copy link

codecov bot commented Dec 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.69%. Comparing base (f8978a3) to head (ffff8c2).
⚠️ Report is 10 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants