Class ClosureDecoratorMiddleware
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.
Namespace: Cake\Http\Middleware
Property Summary
-
$callable protected
Closure
A Closure.
Method Summary
-
__construct() public
Constructor
-
getCallable() public
-
process() public
Run the callable to process an incoming server request.
Method Detail
__construct() ¶ public
__construct(Closure $callable)
Constructor
Parameters
-
Closure
$callable A closure.
process() ¶ public
process(ServerRequestInterface $request, RequestHandlerInterface $handler): Psr\Http\Message\ResponseInterface
Run the callable to process an incoming server request.
Processes an incoming server request in order to produce a response. If unable to produce the response itself, it may delegate to the provided request handler to do so.
Parameters
-
ServerRequestInterface
$request Request instance.
-
RequestHandlerInterface
$handler Request handler instance.
Returns
Psr\Http\Message\ResponseInterface