ClosureDecoratorMiddleware
in package
implements
MiddlewareInterface
Decorate closures as PSR-15 middleware.
Decorates closures with the following signature:
function (
ServerRequestInterface $request,
RequestHandlerInterface $handler
): ResponseInterface
such that it will operate as PSR-15 middleware.
Table of Contents
Interfaces
- MiddlewareInterface
- Participant in processing a server request and response.
Properties
- $callable : Closure
- A Closure.
Methods
- __construct() : mixed
- Constructor
- process() : ResponseInterface
- Run the callable to process an incoming server request.
Properties
$callable
A Closure.
protected
Closure
$callable
Methods
__construct()
Constructor
public
__construct(Closure $callable) : mixed
Parameters
- $callable : Closure
-
A closure.
process()
Run the callable to process an incoming server request.
public
process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface
Parameters
- $request : ServerRequestInterface
-
Request instance.
- $handler : RequestHandlerInterface
-
Request handler instance.