mehr-it/eli-closure-middleware

PSR-15 middleware for closures

1.0.0 2020-01-09 22:41 UTC

This package is auto-updated.

Last update: 2024-10-26 08:58:57 UTC


README

Latest Version on Packagist Build Status

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.