phpstan/phpstan-phpunit
PHPStan extension for PHPUnit: improves type inference for mocks (intersection types for createMock/getMock), understands Foo|MockObject phpDocs, adds early-terminating methods to avoid undefined vars, and refines assert() types. Optional strict rules catch improper assertion usage.
Architecture fit: The package is designed as a PHPStan extension, aligning perfectly with PHP's static analysis ecosystem. It extends PHPStan's core capabilities to handle PHPUnit-specific patterns without requiring major architectural changes. The modular design via neon configuration files allows seamless integration into existing PHPStan setups.
Integration feasibility: High. Installation via Composer is straightforward, and the phpstan/extension-installer automates configuration. Manual setup requires minimal edits to phpstan.neon. The package has clear documentation for both setup and usage scenarios.
Technical risk: Moderate. Potential false positives may occur with legacy test patterns or non-standard PHPUnit usage. Compatibility with PHPUnit versions
How can I help you explore Laravel packages today?