1 | <?php |
||
2 | /** |
||
3 | * Configuration file to add as service in the Di container. |
||
4 | * WeatherApi |
||
5 | */ |
||
6 | return [ |
||
7 | // Services to add to the container. |
||
8 | "services" => [ |
||
9 | "weatherapi" => [ |
||
10 | "shared" => true, |
||
11 | "callback" => function () { |
||
12 | $config = $this->get("configuration")->load("api_keys.php"); |
||
0 ignored issues
–
show
Comprehensibility
Best Practice
introduced
by
![]() |
|||
13 | $apiKey = $config["config"]["openWeather"]["apiKey"]; |
||
14 | |||
15 | $wApi = 'https://api.openweathermap.org/'; |
||
16 | $lApi = 'https://nominatim.openstreetmap.org/'; |
||
17 | |||
18 | $obj = new \Anax\Models\WeatherApi($this, $apiKey, $wApi, $lApi); |
||
19 | return $obj; |
||
20 | } |
||
21 | ], |
||
22 | ], |
||
23 | ]; |
||
24 |