lychee-org/phpstan-lychee
PHPStan extension for Lychee that adds custom rules, stubs, and type information to improve static analysis of Lychee-based Laravel applications. It helps catch Lychee-specific errors earlier, enforce coding standards, and keep analysis consistent across projects.
env() outside config," "no cross-module imports"), this repo is a template of how rules are structured, registered, and shipped.phpstan-strict-rules, phpstan-dba), not this package.Consider it when:
Look elsewhere when:
phpstan/phpstan-strict-rules, phpstan/phpstan-deprecation-rules, and phpstan-dba instead.For executives: This is a small, MIT-licensed rules package maintained by a single open-source project with essentially no external adoption. It is not a dependency we should take on — no support, no track record, negligible ecosystem signal. Its value to us is as a blueprint: a concrete, inexpensive demonstration of how to move code-review conventions into automated CI checks, which reduces reviewer load and keeps multiple repos consistent as we scale. The recommendation is to spend a small amount of engineering time building our own ruleset modeled on this pattern, not to adopt this package.
For engineering: Treat it as a reference implementation. It shows the end-to-end shape of a custom PHPStan rules package: rule classes, registration, and distribution for use across multiple repos. Read it, copy the structure, write rules for our architecture. Two caveats: the ruleset is tuned to Lychee's design and will produce noise in a codebase with different conventions, and with one maintainer and zero dependents you should expect to own any code you take. Keep the investment scoped — a handful of high-value rules (boundary violations, forbidden APIs, deprecations) delivers most of the benefit; a large speculative ruleset does not. Success metric is fewer convention-related review comments and a clean, low-suppression CI gate within one quarter.
How can I help you explore Laravel packages today?