0 follower

Final Class Yiisoft\RequestProvider\RequestCatcherMiddleware

InheritanceYiisoft\RequestProvider\RequestCatcherMiddleware
ImplementsPsr\Http\Server\MiddlewareInterface

Stores request into {@see RequestProviderInterface}.

You need to add this into your application middleware stack.

Method Details

Hide inherited methods

__construct() public method

public mixed __construct ( Yiisoft\RequestProvider\RequestProviderInterface $provider )
$provider Yiisoft\RequestProvider\RequestProviderInterface

The request provider.

                public function __construct(
    private readonly RequestProviderInterface $provider,
) {
}

            
process() public method

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

                public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
    $this->provider->set($request);
    return $handler->handle($request);
}