1 | <?php |
||
10 | class FastRoute |
||
11 | { |
||
12 | use Utils\CallableTrait; |
||
13 | |||
14 | /** |
||
15 | * @var Dispatcher|null FastRoute dispatcher |
||
16 | */ |
||
17 | private $router; |
||
18 | |||
19 | /** |
||
20 | * Constructor. Set Dispatcher instance. |
||
21 | * |
||
22 | * @param Dispatcher|null $router |
||
23 | */ |
||
24 | public function __construct(Dispatcher $router = null) |
||
30 | |||
31 | /** |
||
32 | * Extra arguments passed to the controller. |
||
33 | * |
||
34 | * @param Dispatcher $router |
||
35 | * |
||
36 | * @return self |
||
37 | */ |
||
38 | public function router(Dispatcher $router) |
||
44 | |||
45 | /** |
||
46 | * Execute the middleware. |
||
47 | * |
||
48 | * @param ServerRequestInterface $request |
||
49 | * @param ResponseInterface $response |
||
50 | * @param callable $next |
||
51 | * |
||
52 | * @return ResponseInterface |
||
53 | */ |
||
54 | public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next) |
||
74 | } |
||
75 |