roave/infection-static-analysis-plugin
Runs Psalm static analysis on escaped mutants from Infection test runs, killing mutations that violate your program's type signatures. Improves mutation scores by removing false escapes. Acts as a drop-in replacement for vendor/bin/infection with an extra --psalm-config flag. Note: hacky and slower...
Consider it when:
infection/infection and wants higher-signal mutation results without writing tests for mutants that violate type declarations.vendor/bin/infection, and pins Infection to specific versions.Look elsewhere when:
Executive summary: This is a targeted engineering-quality tool, not a production dependency. It improves mutation-testing signal by treating type-invalid mutants as killed, which can reduce wasted test-writing effort and raise confidence in typed, high-risk Laravel/PHP modules. License cost is low (MIT), but adoption carries CI-time and maintenance costs. Given its maturity signals — modest adoption, no listed dependents, aggressive Infection integration, Psalm-only support, and version pinning — position it as a pilot for critical domain code, not a platform-wide mandate.
Engineering summary: Add roave/infection-static-analysis-plugin as a dev dependency, run vendor/bin/roave-infection-static-analysis-plugin instead of vendor/bin/infection, and provide --psalm-config. Start on a nightly or changed-files job, compare mutation score and escaped mutants before/after, and track CI minutes. Keep plain Infection as a fallback. The main risks are Infection version pinning, slower runs, and dependence on Psalm; the main benefit is fewer low-value tests for mutants that static analysis would reject anyway.
Stakeholder recommendation: Approve a time-boxed pilot on one or two business-critical, well-typed modules. Success criteria: measurable mutation-score improvement, reduced escaped mutants requiring new tests, acceptable CI cost, and no blocked PHP/Infection upgrades. If those hold, expand selectively; otherwise keep standard Infection/static-analysis practices and revisit when native plugin support exists.
How can I help you explore Laravel packages today?