Kris3XIQ /
module
| 1 | <?php |
||
| 2 | /** |
||
| 3 | * Configuration for DI container, set API key. |
||
| 4 | */ |
||
| 5 | return [ |
||
| 6 | "services" => [ |
||
| 7 | "api-service" => [ |
||
| 8 | "shared" => true, |
||
| 9 | "active" => false, |
||
| 10 | "callback" => function () { |
||
| 11 | $service = new \Anax\Service\APIService(); |
||
| 12 | $service->setDi($this); |
||
|
0 ignored issues
–
show
Comprehensibility
Best Practice
introduced
by
Loading history...
|
|||
| 13 | |||
| 14 | // Load configuration file(s) |
||
| 15 | $cfg = $this->get("configuration"); |
||
| 16 | $config = $cfg->load("api-keys"); |
||
| 17 | $settings = $config["config"] ?? null; |
||
| 18 | |||
| 19 | if ($settings["keys"] ?? null) { |
||
| 20 | $service->setKeyChain($settings["keys"]); |
||
| 21 | } |
||
| 22 | |||
| 23 | return $service; |
||
| 24 | } |
||
| 25 | ], |
||
| 26 | ], |
||
| 27 | ]; |
||
| 28 |