0 follower

Final Class Yiisoft\RequestProvider\RequestCatcherMiddleware

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

Stores request into Yiisoft\RequestProvider\RequestProviderInterface.

You need to add this into your application middleware stack.

Method Details

Hide inherited methods

__construct() public method

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

The request provider.

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

            
process() public method

public process( \Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Server\RequestHandlerInterface $handler ): \Psr\Http\Message\ResponseInterface
$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);
}