Class DoublePassDecoratorMiddleware
Decorate double-pass middleware as PSR-15 middleware.
The callable can be a closure with the following signature:
function (
ServerRequestInterface $request,
ResponseInterface $response,
callable $next
): ResponseInterface
or a class with __invoke()
method with same signature as above.
Neither the arguments nor the return value need be typehinted.
Namespace: Cake\Http\Middleware
Property Summary
-
$callable protected
callable
A closure or invokable object.
Method Summary
-
__construct() public
Constructor
-
getCallable() public
-
process() public
Run the internal double pass callable to process an incoming server request.
Method Detail
__construct() ¶ public
__construct(callable $callable)
Constructor
Parameters
-
callable
$callable A closure.
process() ¶ public
process(ServerRequestInterface $request, RequestHandlerInterface $handler): Psr\Http\Message\ResponseInterface
Run the internal double pass 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