Lyco18 /
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 | "coordinates" => [ |
||
| 10 | // Is the service shared, true or false |
||
| 11 | // Optional, default is true |
||
| 12 | "shared" => true, |
||
| 13 | |||
| 14 | // Callback executed when service is activated |
||
| 15 | // Create the service, load its configuration (if any) |
||
| 16 | // and set it up. |
||
| 17 | "callback" => function () { |
||
| 18 | $cfg = $this->get("configuration"); |
||
|
0 ignored issues
–
show
Comprehensibility
Best Practice
introduced
by
Loading history...
|
|||
| 19 | $config = $cfg->load("api.php"); |
||
| 20 | $res = new \Anax\Model\Coordinates($config["config"]["opencage"]["key"]); |
||
| 21 | return $res; |
||
| 22 | } |
||
| 23 | ], |
||
| 24 | ], |
||
| 25 | ]; |
||
| 26 |