| 1 | <?php |
||
| 6 | class NamespaceEndpointFactory implements EndpointFactory { |
||
| 7 | |||
| 8 | protected $endpointNamespace; |
||
| 9 | |||
| 10 | /** |
||
| 11 | * NamespaceEndpointFactory constructor. |
||
| 12 | * @param string $endpointNamespace |
||
| 13 | */ |
||
| 14 | public function __construct(string $endpointNamespace) { |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @param string $name |
||
| 20 | * @param string $version |
||
| 21 | * @return Endpoint |
||
| 22 | * @throws UnknownEndpointException |
||
| 23 | */ |
||
| 24 | public function getEndpoint(string $name, string $version): Endpoint { |
||
| 28 | |||
| 29 | /** |
||
| 30 | * WARNING: Only will find already loaded classes (Won't work with autoloaders). Meant as a basic example. |
||
| 31 | * @param string $version |
||
| 32 | * @return string[] |
||
| 33 | */ |
||
| 34 | public function getSupportedEndpoints(string $version): array { |
||
| 46 | |||
| 47 | protected function buildVersionedEndpointNamespace(string $version): string { |
||
| 50 | } |
||
| 51 |