1 | <?php |
||
2 | /** |
||
3 | * Configuration file for DI container. |
||
4 | */ |
||
5 | return [ |
||
6 | |||
7 | // Services to add to the container. |
||
8 | "services" => [ |
||
9 | "weather" => [ |
||
10 | "shared" => true, |
||
11 | "callback" => function () { |
||
12 | $weather = new \Anax\Weather\WeatherModel(); |
||
13 | |||
14 | // Load the configuration files |
||
15 | $cfg = $this->get("configuration"); |
||
0 ignored issues
–
show
Comprehensibility
Best Practice
introduced
by
![]() |
|||
16 | $config = $cfg->load("key_darksky.php"); |
||
17 | |||
18 | // Set Api key |
||
19 | $weather->setKey($config["config"]["darksky"]["key"]); |
||
20 | $weather->setBaseUrl($config["config"]["darksky"]["baseUrl"]); |
||
21 | $weather->setOptions($config["config"]["darksky"]["options"]); |
||
22 | |||
23 | return $weather; |
||
24 | } |
||
25 | ], |
||
26 | ], |
||
27 | ]; |
||
28 |