Conditions | 1 |
Paths | 1 |
Total Lines | 23 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Tests | 17 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
25 | 1 | public function validateAction() : object |
|
26 | { |
||
27 | 1 | $title = "Väder"; |
|
28 | 1 | $this->api = require ANAX_INSTALL_PATH . "/config/keys.php"; |
|
|
|||
29 | 1 | $this->address = $this->di->get("request")->getPost("address"); |
|
30 | 1 | $page = $this->di->get("page"); |
|
31 | 1 | $curl = $this->di->get("curl"); |
|
32 | |||
33 | 1 | $curl->getIpData($this->address, $this->api["ip_key"]); |
|
34 | 1 | $curl->getWeatherData($this->api["weather_key"]); |
|
35 | |||
36 | 1 | $resOne = $curl->weatherData; |
|
37 | 1 | $resTwo = $curl->ipData; |
|
38 | 1 | $map = $curl->map; |
|
39 | |||
40 | 1 | $page->add("weather/weather_data", [ |
|
41 | 1 | "resOne" => $resOne, |
|
42 | 1 | "resTwo" => $resTwo, |
|
43 | 1 | "map" => $map, |
|
44 | ]); |
||
45 | |||
46 | 1 | return $page->render([ |
|
47 | 1 | "title" => $title, |
|
48 | ]); |
||
51 |