1 | <?php |
||
12 | class RequestHandler extends AbstractMiddleware |
||
13 | { |
||
14 | /** |
||
15 | * @var string Attribute name for handler reference |
||
16 | */ |
||
17 | protected $handlerAttribute = 'request-handler'; |
||
18 | |||
19 | /** |
||
20 | * @var array Extra arguments passed to the handler |
||
21 | */ |
||
22 | protected $arguments = []; |
||
23 | |||
24 | /** |
||
25 | * Set the attribute name to store handler reference. |
||
26 | * |
||
27 | * @param string $handlerAttribute |
||
28 | * |
||
29 | * @return $this |
||
30 | */ |
||
31 | public function handlerAttribute(string $handlerAttribute) |
||
37 | |||
38 | /** |
||
39 | * Extra arguments passed to the handler. |
||
40 | * |
||
41 | * @return $this |
||
42 | */ |
||
43 | public function arguments(...$args) |
||
49 | |||
50 | /** |
||
51 | * Process a server request and return a response. |
||
52 | * |
||
53 | * @param ServerRequestInterface $request |
||
54 | * @param DelegateInterface $delegate |
||
55 | * |
||
56 | * @return ResponseInterface |
||
57 | */ |
||
58 | public function process(ServerRequestInterface $request, DelegateInterface $delegate) |
||
69 | } |
||
70 |