phpstan/phpstan-mockery
PHPStan extension for Mockery: infers intersection types for mocks (Foo&MockInterface), understands shouldReceive/shouldHaveReceived/allows/expects, supports partial/alias/overload mocks, multiple interfaces, and proper constructor args for accurate static analysis.
Architecture fit: This package enhances PHPStan's static analysis for Mockery-based tests, fitting seamlessly into Laravel's dev workflow where PHPUnit + Mockery is standard. It operates purely in the dev environment with zero production impact, improving type safety for mock objects without altering application code. The intersection type handling aligns with PHPStan's core strength in precise type inference.
Integration feasibility: High feasibility. Requires only composer require --dev and automatic configuration via phpstan/extension-installer (or manual extension.neon inclusion). No code changes needed in existing tests—PHPStan automatically leverages the extension during analysis. Compatible with standard Laravel PHPStan setups.
Technical risk: Moderate. Low
How can I help you explore Laravel packages today?