~/talk

PHP ❤️ types

Talkat phpday 2021 · 2021-06-08..06-09· [php]
slides:none on file

Shows how PHP moves from loose typing to concrete safety using Psalm or PHPStan to emulate generics and union types, claiming immediate bug prevention and better domain models. Demonstrates a ValidationResult class with a single process method that forces handling of success and error branches, builds value objects for positive Age and other invariants, and uses phantom-typed Ids plus Psalm/PHPStan templates to keep a single generic repository type-safe, and mentions enum and immutability features coming to PHP.

AI-written summary · about

  1. 0:00Intro
  2. 2:13Introduction
  3. 4:57What are types
  4. 8:50Why use types
  5. 12:20Types in PHP
  6. 16:20Type Checker
  7. 19:12Templates
  8. 22:11Validation
  9. 25:12Invariants
  10. 26:40Models
  11. 35:00Phantom types
  12. 39:52Questions
  13. 40:32My approach
  14. 44:12Laravel
  15. 45:12Primitive types in value objects
  16. 47:02Hardest part of introducing SAM
~/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.