symplify/phpstan-rules
Extra PHPStan rules by Symplify to catch bugs, improve code quality, and enforce consistent conventions. Easy to install and configure, with a broad set of checks for Symfony/Laravel and modern PHP features to keep your codebase clean.
NoTestMocksRule, improving test reliability and maintainability.ForbiddenNewArgumentRule, NoDynamicNameRule), freeing engineers to focus on feature development.Adopt if:
MaximumIgnoredErrorCountRule) or enforcing naming/convention consistency.Look elsewhere if:
For Executives:
"This package automates 80+ code quality checks for our Symfony/Doctrine stack, reducing bugs and onboarding time. For example, it enforces proper dependency injection (no new calls), clean architecture (namespace conventions), and test reliability (no mocks). Early adoption could cut manual code reviews by 30% and align with our modern tech stack goals. Low risk—MIT-licensed and maintained by the Symplify team (creators of Rector)."
For Engineering Leaders: *"Symplify’s PHPStan rules let us enforce best practices at scale without writing custom logic. Key wins:
new RepositoryService() or misplaced #[Entity] classes.NoTestMocksRule.*Command suffixes) and visibility rules.ForbiddenNewArgumentRule, NoDynamicNameRule) and expand. Minimal setup—just add to phpstan.neon."*For Developers: *"This is like a linter for PHPStan—it catches stuff your IDE misses. For example:
#[Route] names.App\Entity\.array_map with callables (use arrow functions instead).phpstan analyse), then add to CI. Start small—pick rules that annoy you most!"*How can I help you explore Laravel packages today?