Conditions | 4 |
Paths | 4 |
Total Lines | 18 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types = 1); |
||
17 | public function __construct() |
||
18 | { |
||
19 | if (!is_file(__DIR__ . '/../../config.php')) { // @codeCoverageIgnore |
||
20 | throw new \Exception('config.php file was not found'); // @codeCoverageIgnore |
||
21 | } |
||
22 | |||
23 | $settings = require __DIR__ . '/../../config.php'; |
||
24 | |||
25 | if (!isset($settings['apiKey'])) { // @codeCoverageIgnore |
||
26 | throw new \Exception('apiKey should be defined in config.php'); // @codeCoverageIgnore |
||
27 | } |
||
28 | |||
29 | if (!is_array($settings['apiKey'])) { |
||
30 | $settings['apiKey'] = [$settings['apiKey']]; |
||
31 | } |
||
32 | |||
33 | $this->apiKeys = $settings['apiKey']; |
||
34 | } |
||
35 | |||
45 |