~/talk

From Helpers to Middleware

Talkat PHP fwdays'18 · on Sunday, 2018-06-10· [web-platform, php]
slides:none on file

Shows concrete migration from helper-heavy apps to a PSR-driven middleware pipeline, with code for a purchase action replaced by composable layers that handle auth, validation and command creation. Names and uses PSR-15 middleware pipeline, Composer + PSR autoloading and Psalm static analysis, mentions ReactPHP for long‑running servers and event sourcing/value objects to reduce mutable state. Claims fewer rewrites, easier testing and less framework coupling; examples are code snippets rather than a live production demo.

AI-written summary · about

  1. 0:00Intro
  2. 0:222002, FIRST WEBSITE PROJECT
  3. 4:31SECURITY? WHAT SECURITY
  4. 4:54PROJECTS USED TO BE "EASY"
  5. 5:28GETS THE JOB DONE
  6. 6:47HELPERS (for transversal concerns)
  7. 7:37FOR A REWRITE
  8. 8:08FEW YEARS LATER...
  9. 8:25FRAMEWORK AUTHORS KNOW WHAT THEY DO
  10. 8:42CONCERNS BEING SEPARATED
  11. 9:30CONTROLLERS
  12. 11:19PROGRESS!
  13. 13:57ANYONE RECOGNIZE THIS?
  14. 15:01TOO MUCH COUPLING WITH THE FRAMEWORK
  15. 15:36SINGLETON FRAMEWORK KERNEL
  16. 16:44TESTING
  17. 20:46UPGRADE = REWRITE
  18. 21:11TDD
  19. 23:07ANOTHER EVOLUTION
  20. 23:23MIDDLEWARE We're doing HTTP stuff anyway
  21. 28:21PSR-O PSR-7 PSR-11 PSR-15
  22. 29:41LOOK MA! NO FRAMEWORK!
  23. 31:33PUSHING IMMUTABILITY
  24. 31:49VALUES AS VALUE OBJECTS
  25. 33:35STATIC ANALYSIS PHPStan, Psalm, Exakat
  26. 34:25MAYBE GENERICS?
  27. 36:58EVENT SOURCING
  28. 37:21DEATH OF ORMS?
  29. 39:54CROSS-CUTTING CONCERNS BECOME FUNCTION COMPOSITION
  30. 40:52WHAT'S THE NEXT JUMP?
~/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.