1 | <?php |
||
13 | class Endpoints implements EndpointsInterface |
||
14 | { |
||
15 | |||
16 | const ENDPOINTS_NAMESPACE = "\\Elasticsearch\\Endpoints\\"; |
||
17 | |||
18 | /** |
||
19 | * @var Transport |
||
20 | */ |
||
21 | private $transport; |
||
22 | |||
23 | /** |
||
24 | * @var SerializerInterface |
||
25 | */ |
||
26 | private $serializer; |
||
27 | |||
28 | /** |
||
29 | * @var AbstractEndpoint[] |
||
30 | */ |
||
31 | private $instances = []; |
||
32 | |||
33 | /** |
||
34 | * {@inheritDoc} |
||
35 | */ |
||
36 | 6 | public function __construct(Transport $transport, SerializerInterface $serializer) |
|
41 | |||
42 | /** |
||
43 | * {@inheritDoc} |
||
44 | */ |
||
45 | 3 | public function __invoke($name) |
|
52 | |||
53 | /** |
||
54 | * {@inheritDoc} |
||
55 | */ |
||
56 | 2 | public function get($id) |
|
69 | |||
70 | /** |
||
71 | * {@inheritDoc} |
||
72 | */ |
||
73 | 3 | public function has($id) |
|
78 | |||
79 | /** |
||
80 | * @param string $endpointClass |
||
81 | * @return string |
||
82 | */ |
||
83 | 2 | private function getEndpointId($endpointClass) |
|
88 | |||
89 | /** |
||
90 | * @param string $id |
||
91 | * @return string |
||
92 | */ |
||
93 | 3 | private function getEndpointClass($id) |
|
97 | |||
98 | /** |
||
99 | * @param string $endpointId |
||
100 | * @return bool |
||
101 | */ |
||
102 | 2 | private function hasInstance($endpointId) |
|
106 | |||
107 | /** |
||
108 | * @param string $id |
||
109 | * @param string $endpointClass |
||
110 | * @return AbstractEndpoint |
||
111 | */ |
||
112 | 2 | private function getNewInstance($id, $endpointClass) |
|
120 | } |
||
121 |