ClosureResponseRequestHandler
in package
implements
RequestHandlerInterface
The closure request handler is basically a message, it contains a closure and a set of parameters to pass to the closure so it can be executed and the response retrieved from the result.
Please note that the return value of the closure is not checked, if it's not a ResponseInterface it will fail.
Interfaces, Classes and Traits
- RequestHandlerInterface
Table of Contents
- $params : array<string|int, mixed>
- $response : ResponseInterface
- __construct() : mixed
- handle() : ResponseInterface
Properties
$params
private
array<string|int, mixed>
$params
$response
private
ResponseInterface
$response
Methods
__construct()
public
__construct(Closure $response, array<string|int, mixed> $params) : mixed
Parameters
- $response : Closure
- $params : array<string|int, mixed>
Return values
mixed —handle()
public
handle(ServerRequestInterface $request) : ResponseInterface
Parameters
- $request : ServerRequestInterface