mehr-it / eli-closure-middleware
PSR-15 middleware for closures
1.0.0
2020-01-09 22:41 UTC
Requires
- php: >=7.1.0
- psr/http-server-middleware: ^1.0
Requires (Dev)
- phpunit/phpunit: ^7.4|^8.0
This package is auto-updated.
Last update: 2024-10-26 08:58:57 UTC
README
This package implements a simple PSR-15 adapter middleware for closures. This way simple closures
can be used to implement middleware functionality. The closure receives the request and the next
handler and must return an instance of ResponseInterface
:
$middleware = new ClosureMiddleware(function ($request, $next) {
/** insert your code here **/
return $response;
});
Not only closures, but any callable
can be passed to the closure middleware.