From Helpers to Middleware
summary
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
chapters (30)
- 0:00Intro
- 0:222002, FIRST WEBSITE PROJECT
- 4:31SECURITY? WHAT SECURITY
- 4:54PROJECTS USED TO BE "EASY"
- 5:28GETS THE JOB DONE
- 6:47HELPERS (for transversal concerns)
- 7:37FOR A REWRITE
- 8:08FEW YEARS LATER...
- 8:25FRAMEWORK AUTHORS KNOW WHAT THEY DO
- 8:42CONCERNS BEING SEPARATED
- 9:30CONTROLLERS
- 11:19PROGRESS!
- 13:57ANYONE RECOGNIZE THIS?
- 15:01TOO MUCH COUPLING WITH THE FRAMEWORK
- 15:36SINGLETON FRAMEWORK KERNEL
- 16:44TESTING
- 20:46UPGRADE = REWRITE
- 21:11TDD
- 23:07ANOTHER EVOLUTION
- 23:23MIDDLEWARE We're doing HTTP stuff anyway
- 28:21PSR-O PSR-7 PSR-11 PSR-15
- 29:41LOOK MA! NO FRAMEWORK!
- 31:33PUSHING IMMUTABILITY
- 31:49VALUES AS VALUE OBJECTS
- 33:35STATIC ANALYSIS PHPStan, Psalm, Exakat
- 34:25MAYBE GENERICS?
- 36:58EVENT SOURCING
- 37:21DEATH OF ORMS?
- 39:54CROSS-CUTTING CONCERNS BECOME FUNCTION COMPOSITION
- 40:52WHAT'S THE NEXT JUMP?
related talks
41mFrom Helpers to Middleware
52mHTTP Patterns: PSR 7 & 15 By Example
26mPipeline Power-Up: Turning Complex Logic into Simple Steps
01h 02mRewriting 12-Year-Old Code
35mSpeed up web APIs with Expressive and Swoole
50mImproving Application Performance with ReactPHP
31mModern PHP development with Laravel 5.6
46mRethinking Server-Side Rendering in Modern PHP Applications
