From 76c2665c93a83bef1bc27e752e65ad8f869d685e Mon Sep 17 00:00:00 2001 From: Maks Rafalko Date: Fri, 14 Aug 2026 16:07:19 +0200 Subject: [PATCH] chore(MSP-5160): run `phpstan` under Infection as a mutant killer, in addition to PHPUnit See https://infection.github.io/guide/static-analysis-integration.html In a nutshell: this will help killing more mutants if they violate PHPStan rules but don't trigger PHPUnit tests failures --- composer.json | 2 +- infection.json5 | 3 ++- phpstan.neon | 6 +++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 2f1dfe15..679143c2 100644 --- a/composer.json +++ b/composer.json @@ -59,7 +59,7 @@ "@lint:php" ], "phpstan": [ - "phpstan analyse --memory-limit=-1 src/ tests/ rector.php --ansi --no-progress" + "phpstan analyse --memory-limit=-1 --ansi --no-progress" ], "rector:check": [ "rector --dry-run --ansi --no-progress-bar" diff --git a/infection.json5 b/infection.json5 index 71c6ffe7..a85e42f5 100644 --- a/infection.json5 +++ b/infection.json5 @@ -8,5 +8,6 @@ "mutators": { "@default": true }, - "maxTimeouts": 0 + "maxTimeouts": 0, + "staticAnalysisTool": "phpstan" } diff --git a/phpstan.neon b/phpstan.neon index 944fe9a0..7d107cca 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -5,9 +5,13 @@ includes: - phar://vendor/phpstan/phpstan/phpstan.phar/conf/bleedingEdge.neon parameters: + paths: + - ./src + - ./tests + - ./rector.php level: max reportUnmatchedIgnoredErrors: false checkExplicitMixed: true - + ignoreErrors: - '#Dynamic call to static method PHPUnit\\Framework\\.*#'