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 Wrapper Laravel Package

wyrihaximus/phpstan-rules-wrapper

Composer wrapper that bundles popular PHPStan rule sets and extensions into one install. Works out of the box with phpstan/extension-installer, pulling in strict, deprecation, PHPUnit, Mockery, dead-code detection, PSR-3, and type-coverage rules.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Code Quality & Maintainability:

    • Adopt a standardized, pre-configured set of PHPStan rules to enforce consistent coding standards across the Laravel/PHP codebase, reducing technical debt and improving developer productivity.
    • Build vs. Buy: Avoid reinventing the wheel by leveraging this wrapper instead of manually configuring individual PHPStan rulesets (e.g., phpstan/phpunit, symplify/phpstan-extensions).
  • Developer Experience (DX) & Onboarding:

    • Reduce friction for new engineers by providing a single dependency that auto-configures best-practice static analysis rules, accelerating onboarding and reducing context-switching.
    • Align with Laravel’s ecosystem by integrating seamlessly with tools like phpstan/extension-installer.
  • Security & Compliance:

    • Enforce deprecation checks (phpstan-deprecation-rules) and PSR-3 compliance (staabm/phpstan-psr3) to mitigate risks from outdated dependencies or non-standard logging practices.
    • Use dead-code-detector to identify unused code, reducing attack surfaces and improving maintainability.
  • Performance & Scalability:

    • Roadmap: Phase in stricter rules (e.g., phpstan-strict-rules) incrementally to avoid breaking changes, while tracking performance impact via type-coverage metrics.
    • Prioritize rules that catch common Laravel-specific issues (e.g., Mockery/PHPUnit integration) to improve test reliability.
  • Cost Efficiency:

    • Eliminate the need for custom rule maintenance by relying on community-vetted, actively updated packages (e.g., symplify/phpstan-extensions for Laravel-specific optimizations).

When to Consider This Package

  • Adopt if:

    • Your team uses Laravel/PHP and lacks a standardized static analysis setup.
    • You prioritize developer productivity over custom rule configurations (e.g., CI/CD pipelines, onboarding).
    • Your codebase is medium-to-large (5K+ lines) and benefits from automated dead-code detection or deprecation warnings.
    • You want low-maintenance static analysis with minimal configuration (works out-of-the-box with extension-installer).
  • Look elsewhere if:

    • Your project requires highly customized PHPStan rules not covered by the included packages (e.g., domain-specific business logic checks).
    • You’re using PHP < 8.4 (wrapper requires PHP 8.4+).
    • Your team prefers manual control over static analysis rules (e.g., for gradual adoption or rule tuning).
    • You need enterprise-grade support (this is a community package with no dependents; consider commercial alternatives like Roave Security or ParagonIE’s PHPStan rules).

How to Pitch It (Stakeholders)

For Executives:

*"This package lets us enforce best-practice PHP code quality without hiring dedicated tooling engineers. By adopting this wrapper, we’ll:

  • Reduce bugs with pre-configured rules for deprecations, dead code, and PSR compliance.
  • Save 20+ hours/month in manual static analysis setup and maintenance.
  • Improve onboarding by standardizing tooling for new hires.
  • Future-proof our Laravel codebase with active community updates (e.g., PHP 8.4+ support). Cost: Zero (MIT-licensed, single Composer dependency). ROI: Immediate productivity gains with negligible risk."*

For Engineering Teams:

*"This is a zero-configuration PHPStan power-up for Laravel projects. Key benefits:

  • One command (composer require wyrihaximus/phpstan-rules-wrapper) adds 8 battle-tested rule sets (e.g., PHPUnit, Mockery, strict rules).
  • No vendor bloat: Uses extension-installer to auto-load rules without bloating your composer.json.
  • Laravel-ready: Includes symplify/phpstan-extensions for framework-specific optimizations.
  • Gradual adoption: Start with lenient rules, then enable stricter ones (e.g., strict-rules) via CI flags. Trade-off: Minimal customization, but ideal for teams that want consistency over control."*

For Developers:

*"Tired of configuring PHPStan rules manually? This wrapper gives you:

  • Dead-code detection (find unused classes/methods).
  • Deprecation warnings (catch outdated Laravel/PHP features early).
  • Strict typing checks (e.g., phpstan-strict-rules) with toggleable severity.
  • Zero setup: Works with your existing phpstan.neon or auto-generates one. How to use:
  1. Install: composer require wyrihaximus/phpstan-rules-wrapper.
  2. Run: ./vendor/bin/phpstan analyse.
  3. Fix errors or adjust rules in phpstan.neon (if needed). Pro tip: Add to CI to catch issues pre-merge!"*
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.
codraw/framework-extra-bundle
codraw/messenger
codraw/security
codraw/mailer
codraw/contracts
codraw/profiling
codraw/dependency-injection
codraw/tester
codraw/core
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony