Tuning PHPStan to Maximum Strictness
summary
Explains how PHPStan enforces strictness by using rule levels 0–9 (level 6 forces missing type hints, 7 flags partially wrong unions, 8 flags nullable misuse, 9 enforces mixed handling), the baseline feature to ignore existing errors while reporting new ones, and the PHPStan Strict Rules package that demands booleans in conditions, forbids empty and loose == comparisons, requires === or strict in_array calls, and disallows dynamic $$ usage and loop-scoped variable leakage; covers check_uninitialized_properties, implicit mixed checks, pure vs impure function handling, bleeding-edge list types, and framework extensions like Doctrine.
AI-written summary · about
chapters (11)
- 0:00PHPStan introduction
- 2:32PHPStan rule levels
- 10:00Baseline feature
- 11:49Strict opinionated checks
- 23:04Implicit mixed types
- 23:47Pure vs impure functions
- 30:38Type strictness options
- 31:40Bleeding edge features
- 38:24Performance benefits
- 39:07PHPStan extensions
- 43:43Q&A
related talks
01h 00mTuning PHPStan to Maximum Strictness
57mTuning PHPStan to Maximum Strictness
54mCrafting Custom PHPStan Rules
45mTesting Strategy with the Help of a Static Analyzer
33mCustom PHPStan Rules: Automate Standards and Save Time
48mThe Best of Strong Typing in PHP
32mFrom Zero to Static Analysis Hero
50mPractical Advanced Static Analysis
