Conditions | 3 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
43 | public static function apiKeyIsValid($apiKey) |
||
44 | { |
||
45 | $client = new Client($apiKey); |
||
46 | |||
47 | try { |
||
48 | $client->get('/manager/me'); |
||
49 | |||
50 | return true; |
||
51 | } catch (ClientException $e) { |
||
52 | if ($e->getResponse()->getStatusCode() === 401) { |
||
53 | return false; |
||
54 | } |
||
55 | |||
56 | throw $e; |
||
57 | } |
||
58 | } |
||
59 | } |
||
60 |