DoublePassDecoratorMiddleware
in package
implements
MiddlewareInterface
Decorate double-pass middleware as PSR-15 middleware.
"Double pass" middleware are deprecated.
Use a Closure
or a class which implements Psr\Http\Server\MiddlewareInterface
instead.
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.
Table of Contents
Interfaces
- MiddlewareInterface
- Participant in processing a server request and response.
Properties
- $callable : callable
- A closure or invokable object.
Methods
- __construct() : mixed
- Constructor
- process() : ResponseInterface
- Run the internal double pass callable to process an incoming server request.
Properties
$callable
A closure or invokable object.
protected
callable
$callable
Methods
__construct()
Constructor
public
__construct(callable $callable) : mixed
Parameters
- $callable : callable
-
A closure.
process()
Run the internal double pass callable to process an incoming server request.
public
process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface
Parameters
- $request : ServerRequestInterface
-
Request instance.
- $handler : RequestHandlerInterface
-
Request handler instance.