~/talk

Object reorientation

Talkat Dutch PHP Conference 2018 · 2018-06-07..06-09· [software-architecture]
slides:none on file

Refactors a 1,000‑line nested switch into small rule classes that implement the mod 11 and related checks, extracts about 14 rules from the spec, and expands test vectors until a third of cases fail (revealing hidden bugs). Introduces a value object for bank account + sort code that enforces validation at construction, uses PHP 7 type hints, returns clones or immutable DateTime to avoid accidental mutation, and adds a factory so downstream code always receives a validated object.

AI-written summary · about

  1. 0:00Intro
  2. 2:18Solid
  3. 5:32Don't repeat yourself
  4. 9:16Reduce invalid states
  5. 12:04Objects should always be valid
  6. 15:25Encapsulate internal state
  7. 17:48Use type hints
  8. 19:34Change or return
  9. 22:07Mutable values
  10. 27:33A case study
  11. 29:12Basic validation
  12. 30:28Mod 11 validation
  13. 34:12Rule classes
  14. 35:37The validator
  15. 36:55A value object
  16. 39:05The factory
~/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.