1 | <?php |
||
9 | class EndpointsContainer |
||
10 | { |
||
11 | /** |
||
12 | * @var RequestInterface |
||
13 | */ |
||
14 | protected $request; |
||
15 | |||
16 | /** |
||
17 | * Array with the cached endpoints |
||
18 | * @var Endpoint[] |
||
19 | */ |
||
20 | protected $endpoints = []; |
||
21 | |||
22 | public function __construct(RequestInterface $request) |
||
26 | |||
27 | /** |
||
28 | * @param string $endpoint |
||
29 | * @return Endpoint |
||
30 | * @throws WrongEndPointException |
||
31 | */ |
||
32 | public function getEndpoint($endpoint) |
||
40 | |||
41 | /** |
||
42 | * @param string $endpoint |
||
43 | * @throws WrongEndPointException |
||
44 | */ |
||
45 | protected function addEndpoint($endpoint) |
||
54 | |||
55 | /** |
||
56 | * @param string $class |
||
57 | * @return Endpoint|object |
||
58 | * @throws WrongEndPointException |
||
59 | */ |
||
60 | protected function createEndpoint($class) |
||
69 | |||
70 | /** |
||
71 | * @return RequestInterface |
||
72 | */ |
||
73 | public function getRequest() |
||
77 | } |