1 | <?php |
||
24 | class GenericServer implements Server |
||
25 | { |
||
26 | /** |
||
27 | * @var AccessControl |
||
28 | */ |
||
29 | protected $accessControl; |
||
30 | /** |
||
31 | * @var Throttle |
||
32 | */ |
||
33 | protected $throttle; |
||
34 | /** |
||
35 | * @var ResponseFactory |
||
36 | */ |
||
37 | protected $responseFactory; |
||
38 | /** |
||
39 | * @var Router |
||
40 | */ |
||
41 | private $router; |
||
42 | |||
43 | /** |
||
44 | * @param AccessControl $accessControl |
||
45 | * @param Throttle $throttle |
||
46 | * @param ResponseFactory $responseFactory |
||
47 | * @param Router $router |
||
48 | */ |
||
49 | 8 | public function __construct( |
|
60 | |||
61 | /** |
||
62 | * @param APIRequest $request |
||
63 | * @return APIResponse |
||
64 | * @throws InvalidAPIKeyException |
||
65 | * @throws AccessDeniedException |
||
66 | * @throws ThrottleLimitExceededException |
||
67 | * @throws UnknownEndpointException |
||
68 | * @throws ElementNotFoundException |
||
69 | * @throws InvalidRequestException |
||
70 | * @throws ElementConflictException |
||
71 | * @throws MethodNotFoundException |
||
72 | * @throws NotAcceptableResponseTypeException |
||
73 | */ |
||
74 | 8 | public function handleRequest(APIRequest $request): APIResponse |
|
94 | |||
95 | /** |
||
96 | * @param APIRequest $request |
||
97 | * @throws InvalidAPIKeyException |
||
98 | */ |
||
99 | 8 | protected function validateKey(APIRequest $request) |
|
105 | |||
106 | /** |
||
107 | * @param APIRequest $request |
||
108 | * @throws NotAcceptableResponseTypeException |
||
109 | */ |
||
110 | 6 | protected function validateAcceptableMIMETypes(APIRequest $request) |
|
124 | } |
||
125 |