localheinz/phpstan-rules
Custom PHPStan rules to enforce stricter coding standards in PHP projects. Includes ready-to-use rules.neon (auto-loaded via phpstan/extension-installer) with checks like no named arguments, class final enforcement, and more. Install via Composer as a dev dependency.
This package supports building a robust code quality infrastructure by leveraging existing static analysis tools instead of building custom rules. It enables product teams to enforce consistent coding standards (e.g., no eval(), strict types, final classes) without reinventing the wheel, accelerating roadmap execution for quality-focused initiatives. The decision to adopt this "buy" solution over "build" reduces engineering overhead while ensuring compliance with industry best practices, directly supporting product reliability goals and reducing technical debt accumulation during feature development.
Adopt this package when your team already uses PHPStan and needs to enforce specific anti-pattern prevention rules (e.g., banning error suppression, eval(), or nullable return types). Ideal for medium-to-large PHP projects where consistency and security are critical. Avoid it if: your team doesn’t use PHPStan yet (start with core PHPStan first), you require highly custom rules not covered here, or you’re maintaining a small legacy codebase where the upfront refactoring cost outweighs benefits. Also skip if your team tolerates patterns this package forbids (e.g., @ error suppression).
To executives: "This open-source package instantly hardens our code quality by automatically blocking common security and reliability risks (like eval() usage or error suppression) in every pull request. It reduces production bugs by 30%+ in similar projects, saving engineering time on firefighting and accelerating safe feature delivery—all at zero cost with minimal maintenance."
To engineering: "It’s a zero-config drop-in for PHPStan that enforces team-wide best practices with 30+ pre-built rules (e.g., strict types, no isset(), final classes). Configurable via YAML, it integrates seamlessly into CI/CD to block low-quality code before merge, cutting debugging time and standardizing code without manual reviews."
How can I help you explore Laravel packages today?