kovagoz / http-middleware-stack
PSR-15 compatible HTTP middleware stack
1.0.0
2021-07-23 19:38 UTC
Requires
- php: >=7.4
- psr/http-message: ^1.0.1
- psr/http-server-handler: ^1.0.1
- psr/http-server-middleware: ^1.0.1
Requires (Dev)
- phpunir/phpunit: ^9.1.4
This package is auto-updated.
Last update: 2025-03-24 03:41:40 UTC
README
Requirements
- PHP >=7.4 (sorry, but I like typed properties)
Usage
You must specify a default response which returns if there is no middleware in the stack or none of them responded.
$stack = new \Kovagoz\Http\MiddlewareStack($defaultResponse); $stack->push(new InnerMiddleware()); $stack->push(new OuterMiddleware()); $response = $stack->handle($serverRequest);