1 | <?php |
||
12 | class Client |
||
13 | { |
||
14 | /** |
||
15 | * @var string base url |
||
16 | */ |
||
17 | const BASE_URL = 'http://api.crowdin.net/api'; |
||
18 | |||
19 | /** |
||
20 | * @var HttpClient |
||
21 | */ |
||
22 | protected $httpClient; |
||
23 | |||
24 | /** |
||
25 | * @var string the project identifier |
||
26 | */ |
||
27 | protected $projectIdentifier; |
||
28 | |||
29 | /** |
||
30 | * @var string the project api key |
||
31 | */ |
||
32 | protected $projectApiKey; |
||
33 | |||
34 | /** |
||
35 | * Instanciate a new Crowdin Client |
||
36 | * |
||
37 | * @param string $identifier the project identifier |
||
38 | * @param string $apiKey the project api key |
||
39 | */ |
||
40 | public function __construct($identifier, $apiKey) |
||
45 | |||
46 | /** |
||
47 | * @param string $method the api method |
||
48 | * |
||
49 | * @throws InvalidArgumentException |
||
50 | * |
||
51 | * @return mixed |
||
52 | */ |
||
53 | public function api($method) |
||
95 | |||
96 | /** |
||
97 | * @return string |
||
98 | */ |
||
99 | public function getProjectIdentifier() |
||
103 | |||
104 | /** |
||
105 | * @return string |
||
106 | */ |
||
107 | public function getProjectApiKey() |
||
111 | |||
112 | /** |
||
113 | * @return HttpClient |
||
114 | */ |
||
115 | public function getHttpClient() |
||
123 | } |
||
124 |