What do we want? Re-use at the web layer!
Superglobals and side-effecting output mechanisms of PHP make this challenging and force every framework to re-invent.
But Symfony's HttpKernelInterface provides a solid interface, which makes creating and sharing framework-agnostic HTTP filters a breeze!
The HttpKernelInterface models web request and response as PHP objects, giving them value semantics.
Stack is a convention for composing HttpKernelInterface middlewares.
By wrapping your application in decorators you can add new behaviour from the outside.
A stack middleware is just an object that follows these conventions:
Yes, leveraging the HTTP interface is that easy!