1 | <?php |
||
29 | class Client implements QueryInterface |
||
30 | { |
||
31 | use HttpTrait; |
||
32 | |||
33 | /** |
||
34 | * @var string |
||
35 | */ |
||
36 | protected $namespace = __NAMESPACE__ . '\\Endpoints'; |
||
37 | |||
38 | /** |
||
39 | * Type of query |
||
40 | * |
||
41 | * @var string |
||
42 | */ |
||
43 | protected $type; |
||
44 | |||
45 | /** |
||
46 | * Endpoint of query |
||
47 | * |
||
48 | * @var string |
||
49 | */ |
||
50 | protected $endpoint; |
||
51 | |||
52 | /** |
||
53 | * Parameters of query |
||
54 | * |
||
55 | * @var mixed |
||
56 | */ |
||
57 | protected $params; |
||
58 | |||
59 | /** |
||
60 | * @var array |
||
61 | */ |
||
62 | protected static $variables = []; |
||
63 | |||
64 | /** |
||
65 | * API constructor. |
||
66 | * |
||
67 | * @param string|array|Config $config |
||
68 | * |
||
69 | * @throws \ErrorException |
||
70 | */ |
||
71 | public function __construct($config) |
||
89 | |||
90 | /** |
||
91 | * Convert underscore_strings to camelCase (medial capitals). |
||
92 | * |
||
93 | * @param string $str |
||
94 | * |
||
95 | * @return string |
||
96 | */ |
||
97 | private function snakeToPascal(string $str): string |
||
102 | |||
103 | /** |
||
104 | * Magic method required for call of another classes |
||
105 | * |
||
106 | * @param string $name |
||
107 | * |
||
108 | * @return bool|object |
||
109 | * @throws \BadMethodCallException |
||
110 | */ |
||
111 | public function __get(string $name) |
||
139 | |||
140 | /** |
||
141 | * Magic method required for call of another classes |
||
142 | * |
||
143 | * @param string $name |
||
144 | * @param array $arguments |
||
145 | * |
||
146 | * @return bool|object |
||
147 | * @throws \BadMethodCallException |
||
148 | */ |
||
149 | public function __call(string $name, array $arguments) |
||
173 | |||
174 | /** |
||
175 | * Check if class is exist in folder |
||
176 | * |
||
177 | * @param string $name |
||
178 | * |
||
179 | * @return bool |
||
180 | */ |
||
181 | public function __isset(string $name): bool |
||
185 | |||
186 | /** |
||
187 | * Ordinary dummy setter, it should be ignored (added to PSR reasons) |
||
188 | * |
||
189 | * @param string $name |
||
190 | * @param mixed $value |
||
191 | * |
||
192 | * @throws \BadMethodCallException |
||
193 | */ |
||
194 | public function __set(string $name, $value) |
||
198 | } |
||
199 |