| Total Complexity | 3 |
| Total Lines | 53 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php // Copyright ⓒ 2018 Magneds IP B.V. - All Rights Reserved |
||
| 9 | class LokaliseClient |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var ClientInterface |
||
| 13 | */ |
||
| 14 | protected $client; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var string |
||
| 18 | */ |
||
| 19 | protected $apiKey; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * LokaliseClient constructor. |
||
| 23 | * @param ClientInterface $client |
||
| 24 | * @param string $apiKey |
||
| 25 | */ |
||
| 26 | public function __construct(string $apiKey, ClientInterface $client = null) |
||
| 27 | { |
||
| 28 | $this->apiKey = $apiKey; |
||
| 29 | |||
| 30 | if (is_null($client)) { |
||
| 31 | $client = new Client([ |
||
| 32 | 'base_uri' => 'https://api.lokalise.co/api/', |
||
| 33 | ]); |
||
| 34 | } |
||
| 35 | |||
| 36 | $this->client = $client; |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @param RequestInterface $request |
||
| 41 | * @return ResponseInfo |
||
| 42 | * @throws \GuzzleHttp\Exception\GuzzleException |
||
| 43 | */ |
||
| 44 | public function send(RequestInterface $request) |
||
| 62 | } |
||
| 63 | } |
||
| 64 |