1 | <?php |
||
13 | class GenericRouter |
||
14 | { |
||
15 | /** |
||
16 | * @var EndpointFactory |
||
17 | */ |
||
18 | private $endpointFactory; |
||
19 | |||
20 | /** |
||
21 | * DefaultRouter constructor. |
||
22 | * @param EndpointFactory $endpointFactory |
||
23 | */ |
||
24 | 3 | public function __construct(EndpointFactory $endpointFactory) |
|
28 | |||
29 | /** |
||
30 | * @param APIRequest $request |
||
31 | * @return null|object|array |
||
32 | * @throws MethodNotFoundException |
||
33 | */ |
||
34 | 3 | public function route(APIRequest $request) |
|
39 | |||
40 | /** |
||
41 | * @param Endpoint $endpoint |
||
42 | * @param APIRequest $request |
||
43 | * @return null|object|array |
||
44 | * @throws MethodNotFoundException |
||
45 | */ |
||
46 | 3 | protected function executeEndpoint(Endpoint $endpoint, APIRequest $request) |
|
54 | |||
55 | 3 | protected function mapEndpointMethod(APIRequest $request): string |
|
59 | } |
||
60 |