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

voku/phpstan-rules

Additional PHPStan rules to catch risky and redundant condition logic and comparisons. Detects double negatives, PHP 8 behavior changes (0 vs ''), insane/invalid comparisons (0=='0foo', 0==='0'), and type-mismatch checks (e.g., object vs non-object).

View on GitHub
Deep Wiki
Context7

Technical Evaluation

  • Architecture fit: High. Designed as a PHPStan extension, it integrates natively into existing PHP static analysis toolchains without architectural changes. Targets dev-only workflows (CI/CD, local development) and aligns with PHP's ecosystem practices.
  • Integration feasibility: High. Simple Composer-based installation (composer require --dev voku/phpstan-rules) and minimal config adjustments (include rules.neon in phpstan.neon). Works seamlessly with phpstan/extension-installer.
  • Technical risk: Medium. Low adoption (31 stars, 0 dependents) raises concerns about long-term maintenance and compatibility with newer PHPStan versions. Potential false positives from strict rules (e.g., Yoda condition checks) could disrupt CI pipelines. DisallowedCallMethodOnNull may conflict with PHPStan's native null checks at higher levels (e.g., level 8).
  • Key questions:
    • What PHPStan versions are explicitly supported?
    • Are there known false positives for core rules (e.g., IfConditionHelper)?
    • How frequently does the maintainer address issues/PRs?
    • Does this package duplicate rules already present in PHPStan's core or other extensions?

Integration Approach

  • Stack fit: Excellent. Native extension for PHPStan with no additional infrastructure dependencies. Complements existing tools like Psalm or static analysis in CI pipelines without conflicts.
  • Migration path:
    1. Add to dev dependencies via Composer.
    2. Update phpstan.neon to include `vendor
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