EvilBengt /
bthramverk1-weather
| 1 | <?php |
||
| 2 | /** |
||
| 3 | * Weather and ExampleWeather as services. |
||
| 4 | */ |
||
| 5 | return [ |
||
| 6 | // Services to add to the container. |
||
| 7 | "services" => [ |
||
| 8 | "weather" => [ |
||
| 9 | "active" => true, |
||
| 10 | "shared" => true, |
||
| 11 | "callback" => function () { |
||
| 12 | $config = $this->get("configuration"); |
||
|
0 ignored issues
–
show
Comprehensibility
Best Practice
introduced
by
Loading history...
|
|||
| 13 | |||
| 14 | $weatherConfig = $config->load("weather"); |
||
| 15 | |||
| 16 | $weather = new EVB\Weather\Weather( |
||
| 17 | $weatherConfig["items"][0]["config"]["darkSkyBaseUrl"], |
||
| 18 | $this->get("multiCurl") |
||
| 19 | ); |
||
| 20 | |||
| 21 | return $weather; |
||
| 22 | } |
||
| 23 | ], |
||
| 24 | "exampleWeather" => [ |
||
| 25 | "active" => true, |
||
| 26 | "shared" => true, |
||
| 27 | "callback" => function () { |
||
| 28 | $config = $this->get("configuration"); |
||
|
0 ignored issues
–
show
Comprehensibility
Best Practice
introduced
by
|
|||
| 29 | |||
| 30 | $weatherConfig = $config->load("weather"); |
||
| 31 | |||
| 32 | $weather = new EVB\Weather\ExampleWeather( |
||
| 33 | $weatherConfig["items"][1]["config"]["example"] |
||
| 34 | ); |
||
| 35 | |||
| 36 | return $weather; |
||
| 37 | } |
||
| 38 | ] |
||
| 39 | ] |
||
| 40 | ]; |
||
| 41 |