Repository navigation
Analyse main with PHPStan at the max level with strict rules - #70
Merged
Merged
Conversation
CI on main only sampled versions (Symfony 8.0 lowest on PHP 8.4, then the newest Symfony 8 on PHP 8.4 and 8.5), so a break on another PHP and Symfony 8 minor pair could go unnoticed. The matrix now runs Symfony 8.0 and 8.1 on PHP 8.4 and 8.5, plus the lowest-dependencies job (PHP 8.4, Symfony 8.0) and the allowed-to-fail nightly (PHP 8.6, Symfony next). The job that lints stays on PHP 8.4, now pinned to Symfony 8.1. Symfony 8.0 no longer gets fixes and its releases have open security advisories, so Composer refuses them: the Symfony 8.0 jobs pass --no-blocking. The PHPStan options move from the command line to phpstan.neon.dist (same level 7, same paths) so CI and the Makefile read one configuration. ci.yml is regenerated with the CI generator.
PHPStan ran at level 7 without the strict rules, so mixed values, loose comparisons and other unsafe code went unreported on main. phpstan.neon.dist now sets the max level, analyses for PHP 8.4 (the main floor) and loads phpstan/phpstan-strict-rules, with no baseline and no ignored errors. The code already passes: the fixes PHPStan asked for on 6.x and 7.x reached main with the 7.x merge-up.
|
tattali
added a commit
that referenced
this pull request
Oct 18, 2026
Stacked on #70. Passing tests say nothing about whether they would notice a wrong change in the code. Infection mutates src and fails the run when the tests catch fewer mutants than today. - `infection/infection` (^0.35) joins require-dev, and its extension installer is allowed as a Composer plugin. - `infection.json5` runs the default mutators on src with `minMsi: 87` and `minCoveredMsi: 87`. - Measured on PHP 8.4 with Symfony 8.1 and Xdebug: 358 mutants, 313 killed, 45 escaped, 0 uncovered; MSI 87.43%, covered code MSI 87.43%, mutation code coverage 100%. The thresholds are those scores rounded down. - The current CI job (PHP 8.4, Symfony 8.1) runs `vendor/bin/infection --threads=max --no-progress --show-mutations` after PHPUnit; the other jobs remove Infection before installing. `.github/workflows/ci.yml` is generated with the CI generator. Local checks: Infection passes with these thresholds (exit 0) and fails with `--min-msi=88` (exit 1).
This branch was successfully deployed
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.



Stacked on #69 (it needs that pull request's phpstan.neon.dist).
PHPStan ran at level 7 without the strict rules, so mixed values, loose comparisons and other unsafe code went unreported on main.
level: maxandphpVersion: 80400(the main floor, PHP 8.4), and keeps the src and tests paths.phpstan/phpstan-strict-rulesjoins require-dev; phpstan-phpunit and phpstan-symfony were already there, and the extension installer loads all three.Local checks on PHP 8.4 with Symfony 8.1: PHPStan 2.3.1 reports no errors with the three extensions loaded. CI runs PHPStan in the current job (PHP 8.4, Symfony 8.1).