1 | <?php |
||
32 | class EndpointsContainer |
||
33 | { |
||
34 | /** |
||
35 | * @var Request |
||
36 | */ |
||
37 | protected $request; |
||
38 | |||
39 | /** |
||
40 | * Array with the cached endpoints |
||
41 | * @var Endpoint[] |
||
42 | */ |
||
43 | protected $endpoints = []; |
||
44 | |||
45 | public function __construct(Request $request) |
||
49 | |||
50 | /** |
||
51 | * @param string $endpoint |
||
52 | * @return Endpoint |
||
53 | */ |
||
54 | public function __get($endpoint) |
||
58 | |||
59 | /** |
||
60 | * @param string $method |
||
61 | * @param array $arguments |
||
62 | * @return EndpointsContainer |
||
63 | * @throws HeadHunterApiException |
||
64 | */ |
||
65 | public function __call($method, $arguments) |
||
73 | |||
74 | /** |
||
75 | * @param string $endpoint |
||
76 | * @return Endpoint |
||
77 | * @throws WrongEndPointException |
||
78 | */ |
||
79 | public function getEndpoint($endpoint) |
||
87 | |||
88 | /** |
||
89 | * @param string $endpoint |
||
90 | * @throws WrongEndPointException |
||
91 | */ |
||
92 | protected function addEndpoint($endpoint) |
||
102 | |||
103 | /** |
||
104 | * @param string $class |
||
105 | * @return Endpoint|object |
||
106 | * @throws WrongEndPointException |
||
107 | */ |
||
108 | protected function createEndpoint($class) |
||
118 | |||
119 | /** |
||
120 | * @return Request |
||
121 | */ |
||
122 | public function getRequest() |
||
126 | |||
127 | /** |
||
128 | * @param string $method |
||
129 | * @param array $arguments |
||
130 | * @return $this |
||
131 | */ |
||
132 | protected function callRequestSetter($method, $arguments) |
||
138 | |||
139 | /** |
||
140 | * @param $method |
||
141 | * @return bool |
||
142 | */ |
||
143 | protected function isRequestSetter($method) |
||
147 | } |