1 | <?php |
||
15 | class Router { |
||
16 | /** |
||
17 | * @var EndpointFactory |
||
18 | */ |
||
19 | private $endpointFactory; |
||
20 | |||
21 | /** |
||
22 | * @param EndpointFactory $endpointFactory |
||
23 | */ |
||
24 | public function __construct(EndpointFactory $endpointFactory){ |
||
27 | |||
28 | /** |
||
29 | * @param Request $request |
||
30 | * @return ResponseData |
||
31 | * @throws UnknownEndpointException |
||
32 | * @throws MethodNotFoundException |
||
33 | */ |
||
34 | public function route(Request $request): ResponseData{ |
||
38 | |||
39 | /** |
||
40 | * @param Endpoint $endpoint |
||
41 | * @param Request $request |
||
42 | * @return ResponseData |
||
43 | * @throws MethodNotFoundException |
||
44 | */ |
||
45 | protected function executeEndpoint(Endpoint $endpoint, Request $request): ResponseData { |
||
51 | } |
||
52 |