~/talk

Types in Laravel

Talkat Laracon Online Summer 2021 · on Wednesday, 2021-09-01· [php, typescript]
slides:none on file

Argues that adding static analysis to Laravel catches bugs before runtime by using phpstan + larastan to analyze code, raising phpstan level gradually to avoid thousands of errors; shows enabling checking_missing_iterable_value_type in phpstan.neon and adding docblock generics (array<int,string>, Collection<TKey,TValue>) so phpstan infers wrong returns, unreachable dd, and mixed-value bugs. Demonstrates writing a fully generic Collection stub with templates and map return types, integrates checks into CI, and confirms phpstan then reports no remaining issues.

AI-written summary · about

  1. 0:00Introduction and sponsor
  2. 1:27PHP type system basics
  3. 3:02The goal of type checking
  4. 5:12Introduction to PHPStan
  5. 7:17Fixing bugs with PHPStan
  6. 10:10Gradual strictness levels
  7. 12:29Debugging with PHPStan
  8. 15:51Using generics in PHP
  9. 20:07Laravel collections and stubs
  10. 24:34Implementing custom generics
  11. 32:41IDE autocompletion benefits
  12. 33:56Type consistency and summary
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 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
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
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.