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