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.
amashukov/lnd-client-php
althinect/enum-permission
andydefer/laravel-actions
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor