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.

Properties summary

  • $callable protected
    callable

    A closure or invokable object.

Method Summary

Method Detail

__construct() public

__construct(callable $callable)

Constructor

Parameters

callable $callable

A closure.

getCallable() public

getCallable()

Returns

callable

process() public

process(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Server\RequestHandlerInterface $handler)

Run the internal double pass callable to process an incoming server request.

Parameters

\Psr\Http\Message\ServerRequestInterface $request

Request instance.

\Psr\Http\Server\RequestHandlerInterface $handler

Request handler instance.

Returns

\Psr\Http\Message\ResponseInterface

Property Detail

$callable protected

A closure or invokable object.

Type

callable

© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/4.1/class-Cake.Http.Middleware.DoublePassDecoratorMiddleware.html