types/strict/php
The type checker runs in strict mode
Implements types/strict for php.
| Severity | warning |
| Tiers | 1, 2 |
| Stacks | php |
| Scope | each |
| Kind | outcome |
| Source | library v0.1.0 |
| Selected by | fleetlint-recommended@v0.1.0 |
Requirement
PHPStan runs at level: max (or 9 or 10) or Psalm at errorLevel="1", configured in the project or a parent directory; a generated baseline is the ratchet for existing code. Another analyzer is added with accept:.
Why
PHPStan’s lower levels skip mixed types and missing type information, which is exactly what the analyzer is there to refuse.
Fix
Set level: max in phpstan.neon.dist and ratchet existing errors with vendor/bin/phpstan analyse --generate-baseline.
Agent instruction: Set level: max in phpstan.neon.dist, generate a baseline for existing errors, and fix new code to pass without it.
See: https://fleetlint.org/baseline/#static-analysis, https://fleetlint.org/stacks/#php
Generated by fleetlint docs from catalog v0.1.0.