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) |
||
104 | |||
105 | /** |
||
106 | * @return Request |
||
107 | */ |
||
108 | public function getRequest() |
||
112 | |||
113 | /** |
||
114 | * @param string $method |
||
115 | * @param array $arguments |
||
116 | * @return $this |
||
117 | */ |
||
118 | protected function callRequestSetter($method, $arguments) |
||
124 | |||
125 | /** |
||
126 | * @param $method |
||
127 | * @return bool |
||
128 | */ |
||
129 | protected function isRequestSetter($method) |
||
133 | } |