1 | <?php |
||
9 | class Handler implements RequestHandlerInterface |
||
10 | { |
||
11 | /** |
||
12 | * @var array |
||
13 | */ |
||
14 | private $middleware; |
||
15 | |||
16 | /** |
||
17 | * @var callable |
||
18 | */ |
||
19 | private $default; |
||
20 | |||
21 | /** |
||
22 | * @var integer |
||
23 | */ |
||
24 | private $index = 0; |
||
25 | |||
26 | /** |
||
27 | * @param array $middleware |
||
28 | * @param callable $default |
||
29 | */ |
||
30 | 4 | public function __construct(array $middleware, callable $default) |
|
35 | |||
36 | 4 | public function handle(ServerRequestInterface $request): ResponseInterface |
|
44 | |||
45 | /** |
||
46 | * Get a handler pointing to the next middleware. |
||
47 | * |
||
48 | * @return static |
||
49 | */ |
||
50 | 2 | private function nextHandler() |
|
57 | } |
||
58 |