PHPStan core gets you to level 10 with solid type checks. But some gems, the rules that catch your anti-patterns, live scattered across a dozen community packages most people never hear about.
I got tired of hunting through GitHub READMEs to find "is there a rule for this?", so I built a single searchable page that indexes 11 custom PHPStan rules packages.
You spot the same code smell in pull request after pull request - a static method here, a forbidden dd() in production there - and you think:
"Surely someone already wrote a PHPStan rule for this?"
They probably did. The problem is finding it.
We had the same problem with Rector rules - so many that people kept re-implementing ones that already existed. I built the "Find rule" page to fix it.
These project-specific rules live in community packages: symplify/phpstan-rules, shipmonk/phpstan-rules, ergebnis/phpstan-rules, spaze/phpstan-disallowed-calls, and a long tail of smaller ones.
Each ships its own README and naming, often with just a generic package description. To answer "is there a rule for X?", you'd open a dozen tabs - nobody does that. So great rules sit unused, only their authors know about them, and we keep eyeballing the same problems by hand in code review.
So I made a single page that indexes them all: PHPStan Rules Beyond Core
A searchable index of 260+ rules from 11 popular community packages. Each entry shows:
phpstan.neonDiscovery is the point, so type what's on your mind - no exact class name needed:
...or "final abstract" - it marks all non-abstract methods of abstract classes as final. Surprisingly useful; fixed 2 cases on my own site.
Found one? Each package block has a ready-to-copy install line:
composer require --dev symplify/phpstan-rules
Then register the rule in your phpstan.neon:
rules:
- Ergebnis\PHPStan\Rules\Methods\FinalInAbstractClassRule
...and run PHPStan:
vendor/bin/phpstan
Keep this one or explore the full package. That's how PHPStan rules should work - solve one specific issue and catch it in CI before we even tell our agent.
Missing a package? Open an issue or send a PR (this site is 100 % open source) - I'd love to improve the index.
Happy coding!