1 | <?php |
||
2 | /** |
||
3 | * Configuration file for DI container. |
||
4 | */ |
||
5 | return [ |
||
6 | // Services to add to the container. |
||
7 | "services" => [ |
||
8 | "weather" => [ |
||
9 | "shared" => true, |
||
10 | "callback" => function () { |
||
11 | $weather = new \Blixter\Weather\WeatherModel(); |
||
12 | // Load the configuration files |
||
13 | $cfg = $this->get("configuration"); |
||
0 ignored issues
–
show
Comprehensibility
Best Practice
introduced
by
![]() |
|||
14 | $config = $cfg->load("keys.php"); |
||
15 | $config = $config["config"] ?? null; |
||
16 | $weather->setApi($config['darkSkyApiKey']); |
||
17 | return $weather; |
||
18 | }, |
||
19 | ], |
||
20 | ], |
||
21 | ]; |
||
22 |