| Conditions | 3 |
| Paths | 4 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 41 | public function __construct(ClientInterface $client, $key, $format = 'json') |
||
| 42 | { |
||
| 43 | // Prepare required data |
||
| 44 | $this->http = $client; |
||
| 45 | $format = $format === 'xml' ? 'xml' : 'json'; |
||
| 46 | $this->params = ['http_errors' => false, 'headers' => ['X-Authy-API-Key' => $key]]; |
||
| 47 | $this->api = "https://api.authy.com/protected/{$format}/"; |
||
| 48 | |||
| 49 | // Check configuration |
||
| 50 | if (! $key) { |
||
| 51 | throw InvalidConfiguration::missingCredentials(); |
||
| 52 | } |
||
| 53 | } |
||
| 54 | } |
||
| 55 |