1 | <?php |
||
14 | class Delegate implements DelegateInterface |
||
15 | { |
||
16 | /** |
||
17 | * @var callable |
||
18 | */ |
||
19 | private $callback; |
||
20 | |||
21 | /** |
||
22 | * @param callable $callback function (RequestInterface $request) : ResponseInterface |
||
23 | */ |
||
24 | 1 | public function __construct(callable $callback) |
|
28 | |||
29 | /** |
||
30 | * Dispatch the next available middleware and return the response. |
||
31 | * |
||
32 | * @param RequestInterface $request |
||
33 | * |
||
34 | * @return ResponseInterface |
||
35 | */ |
||
36 | 1 | public function process(RequestInterface $request) |
|
40 | |||
41 | /** |
||
42 | * Dispatch the next available middleware and return the response. |
||
43 | * |
||
44 | * This method duplicates `next()` to provide backwards compatibility with non-PSR 15 middleware. |
||
45 | * |
||
46 | * @param RequestInterface $request |
||
47 | * |
||
48 | * @return ResponseInterface |
||
49 | */ |
||
50 | 1 | public function __invoke(RequestInterface $request) |
|
54 | } |
||
55 |