| 1 | <?php |
||
| 9 | class EndpointsContainer |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var RequestInterface |
||
| 13 | */ |
||
| 14 | private $request; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Array with the cached endpoints |
||
| 18 | * @var Endpoint[] |
||
| 19 | */ |
||
| 20 | private $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 | private function addEndpoint($endpoint) |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @param string $class |
||
| 57 | * @return Endpoint |
||
| 58 | * @throws WrongEndPointException |
||
| 59 | */ |
||
| 60 | private function createEndpoint($class) |
||
| 69 | } |