PH

PHPStan + PHP-CS-Fixer

Used in 72 php projects (avg ★116)

PHP
Linter / Formatter
Default
Used by 72 projects

Details

Language / Topic
phpPHP
Category
Linter / Formatter

Rules

balanced
- Use PHPStan for static analysis. Set `level: 8` (or max) in `phpstan.neon` for strictest checking.
- Run `phpstan analyse src tests` in CI. Fix all reported issues.
- Start at PHPStan level 5 and increase gradually to level 9 — use `phpstan.neon` for configuration and `@phpstan-ignore` sparingly.
- Use `phpstan-strict-rules` extension for additional strictness (no mixed types, no dynamic properties).
- Use `larastan` extension for Laravel-specific analysis (Eloquent, facades, config).
- Use PHPStan baseline (`phpstan-baseline.neon`) for gradually adopting stricter levels on legacy code.
- Combine with PHP-CS-Fixer: PHPStan finds bugs, PHP-CS-Fixer enforces style.