esfahanahan/phpstan-rules
A collection of custom PHPStan rules for Laravel and PHP projects, helping teams catch architectural and coding issues early. Drop it into your phpstan.neon config to enforce stricter static analysis and keep code quality consistent across the codebase.
Architecture fit: The package appears to be Laravel/PHP developer tooling — most likely a static-analysis or linting package that inspects Eloquent usage and reports inefficient relationship loading patterns. v1.1.0 adds a rule that flags load() calls which reload a constrained parent relation. That places it in the code-quality and CI tooling layer, not in application runtime architecture. It is therefore additive: no production code paths, service contracts, or data flows are affected.
Integration feasibility: High for a Laravel codebase. The change is a new diagnostic rule, not a runtime dependency or API change. It should be installable as a dev dependency and runnable in local pre-commit hooks or CI. The main integration work is configuration and baseline management, not application code changes.
Technical risk: Low-to-moderate. The release note does not indicate breaking changes, deprecations, or required migrations. The primary risks are false positives from the new rule, CI noise on existing code, and rule behavior differences across Laravel/Eloquent versions. Because the package inspects relationship-loading semantics, it may produce findings that are technically correct but contextually acceptable — for example, constrained eager loads that are intentional for readability or cache-warming.
Key questions:
Stack fit: Suitable for Laravel/PHP teams already using static analysis, PHPStan/Larastan, Pint, or custom CI lint steps. It complements existing quality gates rather than replacing them. The new rule targets a narrow Eloquent anti-pattern, so it fits best as a non-blocking advisory check initially.
Migration path: Treat v1.1.0 as an incremental tooling upgrade. Add or bump the package in require-dev, run it against the repository in report-only mode, capture the initial findings, and decide whether to baseline existing violations. No database, queue, or deployment migration is required.
Compatibility: Confirm that the package supports the project’s PHP and Laravel versions before upgrading. Since the release note mentions only a new diagnostic, compatibility risk is likely limited to the package’s own supported-version matrix rather than application code. If the repository spans multiple Laravel versions, run the rule in each supported CI matrix leg.
Sequencing:
Maintenance: Low. The package is development tooling with no production runtime footprint. Ongoing maintenance is limited to version bumps, rule configuration, and periodic baseline review.
Support: Support burden is primarily developer education: teams need to understand why a constrained load() may be reported and when to refactor versus suppress. The release note is terse, so internal documentation should capture the rule’s intent and accepted exceptions.
Scaling: Scales with CI capacity, not application traffic. For large monorepos, runtime may become noticeable if the analyzer scans the full codebase on every commit. Use changed-file analysis or caching where supported.
Failure modes:
Ramp-up: Minimal for Laravel developers familiar with Eloquent. A short internal note and one example finding should be sufficient. TPM-level effort is mainly coordination: confirm package ownership, define the rollout gate, and set expectations that v1.1.0 is a quality improvement rather than a functional change.
Assessment caveat: No prior assessment or package metadata was provided. This evaluation is based solely on the v1.1.0 release note and should be revisited once the package name, support matrix, and configuration options are confirmed.
How can I help you explore Laravel packages today?