~/talk

Tuning PHPStan to Maximum Strictness

Talkat phpday 2022 · 2022-05-19..05-20· [php]
slides:none on file

Shows how to push PHPStan from level defaults into production-ready strictness by flipping configs and enabling packages so code becomes more predictable and readable. Demonstrates the rule levels 0–9, recommends running at least level 5 and explains level 9’s checks on mixed; generates a baseline file to ignore historical violations; uses the strict rules package to forbid ambiguous conditions, require parent constructors, and opt into checking uninitialized properties. Results: fewer runtime surprises and an incremental path to stricter typing.

AI-written summary · about

  1. 0:00Start
  2. 8:58Rule Levels
  3. 11:41Partially wrong union type
  4. 15:28The Baseline
  5. 22:37PHPDoc type instead
  6. 25:12Fighting level 9 Untyped JSON data
  7. 25:51What does the function do?
  8. 27:06Conditional types
  9. 36:02Check uninitialized properties
  10. 41:53Exception categorization
  11. 44:45What does missing @throws mean?
  12. 47:38Always use the latest version
  13. 49:03Bleeding edge
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.