Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Phpstan Rules Laravel Package

ergebnis/phpstan-rules

A set of extra PHPStan rules to enforce stricter, opinionated code standards in PHP projects. Install via Composer and include rules.neon (auto via phpstan/extension-installer) to catch issues like named arguments, class design, and more.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Enforces consistent coding standards across the team by automating checks for anti-patterns (e.g., no eval(), strict types declaration, final classes) to reduce technical debt and improve maintainability.
  • Validates "build vs buy" decisions by providing a ready-made, battle-tested rule set instead of developing custom PHPStan extensions, saving engineering effort.
  • Supports roadmap prioritization for code quality initiatives by integrating into CI/CD pipelines to catch issues early, preventing low-quality code from reaching production.
  • Enables scalable onboarding of new developers through standardized, self-documenting code conventions (e.g., PHPUnit test class naming rules).

When to Consider This Package

  • Adopt when using PHPStan as part of the static analysis workflow and needing additional rules beyond core/strict rules (e.g., enforcing declare(strict_types=1), banning error suppression, or mandating final classes).
  • Ideal for teams targeting strict adherence to modern PHP best practices (e.g., no named arguments, no nullable parameter types) or compliance with internal coding standards.
  • Avoid if the project doesn’t use PHPStan, or if specific rules conflict with existing practices (e.g., allowing named arguments would require disabling NoNamedArgumentRule).
  • Consider alternatives like custom rules or other linters if the required rules aren’t covered or if the project uses a different static analysis tool.

How to Pitch It (Stakeholders)

  • Executives: "This tool automates enforcement of industry best practices, reducing production bugs and maintenance costs by 30%+ through early detection in CI pipelines. It eliminates manual code review overhead for common pitfalls—like eval() or error suppression—while improving product reliability and developer velocity."
  • Engineering: "It extends PHPStan with pre-built, customizable rules to eliminate recurring code issues (e.g., non-final classes, nullable parameters) in seconds. Setup is trivial via Composer, and rules can be tailored to your team’s standards—freeing engineers to focus on feature development instead of policing trivial style violations."
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4