roave/infection-static-analysis-plugin
Runs Psalm static analysis on Infection’s generated mutants to mark type-invalid mutations as killed, boosting mutation scores. Use it as a drop-in wrapper for vendor/bin/infection and pass through all Infection flags plus --psalm-config.
## Technical Evaluation
**Architecture fit:** The package’s core purpose—augmenting Infection with static analysis—remains theoretically aligned with Laravel’s quality toolchain, but the **forced PHP 8.2 maximum support** (via PHPUnit v13) creates a **hard architectural conflict** with Laravel’s PHP 8.3+ requirement (Laravel 11.x+). The **lack of new features** and **stagnant development** (0 issues resolved, 2 Renovate-driven PRs) further undermine its relevance. The **dependency on Infection v0.32.0** (now compounded by PHPUnit v13’s constraints) introduces **compatibility risks** with Laravel’s evolving testing ecosystem (e.g., Pest, Laravel Shift). The **future-dated release (2025-12-29)** and **abandonware risk** (no human contributors) make this package **unsustainable** for production use in modern Laravel projects.
**Integration feasibility:** The **PHP 8.3 deprecation** is a **blocking breaking change** for Laravel teams, requiring either a **PHP downgrade** or abandonment. The **automated Renovate updates** (e.g., `azjezz/psl` v6, PHPUnit v13) signal **reactive maintenance**, not proactive development. The **absence of contributor activity** and **undocumented breaking changes** (e.g., PHPUnit v13’s migration impact) introduce **high integration risk**. Security risks escalate due to **unpatched dependencies** and **no maintenance roadmap**.
**Technical risk:** **Critical** due to:
- **PHP 8.2 hard limit**: Laravel 11.x+ projects **cannot** use this package without downgrading PHP, violating Laravel’s version support policy.
- **Dependency conflicts**: Infection v0.32.0 + PHPUnit v13 may **break Laravel’s testing stack** (e.g., Pest, Dusk, API testing).
- **Static analysis gaps**: No updates to Psalm/PHPStan support despite `azjezz/psl` v6 bump (potential breaking changes for users).
- **Maintenance collapse**: **No human contributors**; package is effectively **abandoned**.
- **Undocumented risks**: PHPUnit v13’s migration may introduce **subtle failures** (e.g., assertion changes, test listener incompatibilities).
**Key questions:**
1. **Does Infection v0.32.0 + PHPUnit v13 support Laravel’s modern testing features** (e.g., Pest, Dusk, API testing)?
2. **What are the breaking changes in PHPUnit v13** that may affect Infection’s mutation testing or static analysis integration?
3. **How does `azjezz/psl` v6 impact Psalm compatibility** (e.g., new rules, deprecated features)?
4. **Is there a plan to support PHP 8.3+**, or will this package require a Laravel fork?
5. **What is the repository’s end-of-life timeline**? Will future Laravel versions break compatibility entirely?
6. **Are there alternatives** (e.g., standalone Infection + custom static analysis) that avoid PHP downgrades?
---
## Integration Approach
**Stack fit:** The package **explicitly conflicts** with Laravel’s modern stack (PHP 8.3+, Laravel 11.x+). Integration requires:
- **PHP downgrade**: Teams must revert to PHP 8.2 or accept **broken functionality**.
- **Testing stack adjustments**: PHPUnit v13 may require updates to Laravel’s `phpunit.xml` (e.g., new configuration keys, dropped features).
- **Static analysis tooling**: Psalm/PHPStan users must verify `azjezz/psl` v6 compatibility (e.g., new error levels, rule changes).
- **CI/CD**: GitHub Actions or other CI systems must explicitly pin PHP 8.2 if using this package.
**Migration path:**
1. **Pre-integration checks**:
- **PHP version**: Confirm PHP 8.2 is supported (run `php -v`; Laravel 11.x+ **requires PHP 8.3**).
- **PHPUnit compatibility**: Audit `phpunit.xml` for v13 breaking changes (e.g., [PHPUnit 13 Upgrade Guide](https://phpunit.readthedocs.io/en/13.0/upgrade-guide.html)).
- **Static analysis tools**: Test Psalm/PHPStan with `azjezz/psl` v6 for regressions.
2. **Installation** (if proceeding):
```bash
composer require --dev roave/infection-static-analysis-plugin:^1.44.0
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
phpunit.xml for PHPUnit v13 (e.g., add <extensions> for new test listeners)../vendor/bin/infection --show-mutations --static-analysis --phpunit-config=phpunit.xml
Compatibility:
azjezz/psl v6 may introduce new rules or deprecations.ReflectionClass::newInstanceArgs).Sequencing:
Maintenance:
azjezz/psl v6 must be locked to specific versions to avoid breakage.Support:
infectionphp/infection + custom static analysis scripts).Scaling:
Failure modes:
Ramp-up:
azjezz/psl v6.How can I help you explore Laravel packages today?