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.
assertTrue instead of assertSame(true)), reducing false positives and test flakiness.assertSame for booleans/null).assertSame(true) → assertTrue). Reduces manual code reviews for test quality, ensures consistent assertion usage, and improves mock object reliability with precise type inference."How can I help you explore Laravel packages today?