1 | <?php |
||
36 | class EndpointsContainer |
||
37 | { |
||
38 | /** |
||
39 | * @var Request |
||
40 | */ |
||
41 | protected $request; |
||
42 | |||
43 | /** |
||
44 | * Array with the cached endpoints |
||
45 | * @var Endpoint[] |
||
46 | */ |
||
47 | protected $endpoints = []; |
||
48 | |||
49 | public function __construct(Request $request) |
||
53 | |||
54 | /** |
||
55 | * @param string $endpoint |
||
56 | * @return Endpoint |
||
57 | */ |
||
58 | public function __get($endpoint) |
||
62 | |||
63 | /** |
||
64 | * @param string $method |
||
65 | * @param array $arguments |
||
66 | * @return EndpointsContainer |
||
67 | * @throws HeadHunterApiException |
||
68 | */ |
||
69 | public function __call($method, $arguments) |
||
77 | |||
78 | /** |
||
79 | * @param string $endpoint |
||
80 | * @return Endpoint |
||
81 | * @throws WrongEndPointException |
||
82 | */ |
||
83 | public function getEndpoint($endpoint) |
||
91 | |||
92 | /** |
||
93 | * @param string $endpoint |
||
94 | * @throws WrongEndPointException |
||
95 | */ |
||
96 | protected function addEndpoint($endpoint) |
||
106 | |||
107 | /** |
||
108 | * @return Request |
||
109 | */ |
||
110 | public function getRequest() |
||
114 | |||
115 | /** |
||
116 | * @param string $method |
||
117 | * @param array $arguments |
||
118 | * @return $this |
||
119 | */ |
||
120 | protected function callRequestSetter($method, $arguments) |
||
126 | |||
127 | /** |
||
128 | * @param string $method |
||
129 | * @return bool |
||
130 | */ |
||
131 | protected function isRequestSetter($method) |
||
135 | |||
136 | /** |
||
137 | * @param string $class |
||
138 | * @return bool |
||
139 | */ |
||
140 | protected function checkIsEndpoint($class) |
||
146 | } |