Completed
Push — master ( fd3af1...afc518 )
by Christofer
02:50
created
src/Controller/WeatherController.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -18,8 +18,8 @@  discard block
 block discarded – undo
18 18
         $api = $this->di->get("ipstack");
19 19
         $ipstack = $api["config"];
20 20
         $getipInfo = new Models\Curl;
21
-        $extra =  "&fields=ip";
22
-        $userIp =  $getipInfo->cUrl($ipstack["url"]. "check". '?access_key='. $ipstack["key"]. $extra);
21
+        $extra = "&fields=ip";
22
+        $userIp = $getipInfo->cUrl($ipstack["url"]."check".'?access_key='.$ipstack["key"].$extra);
23 23
         $apiResult = json_decode($userIp, true);
24 24
 
25 25
         $session->set("userIp", $apiResult["ip"]);
@@ -51,12 +51,12 @@  discard block
 block discarded – undo
51 51
 
52 52
         $extra = "?lang=sv&units=auto";
53 53
         $mapDiv = $map->getMap($location["latitude"], $location["longitude"]);
54
-        $weatherJson = $getJson->cUrl($darksky["config"]["url"]. $darksky["config"]["key"]. "/". $location["latitude"]. ",". $location["longitude"]. $extra);
54
+        $weatherJson = $getJson->cUrl($darksky["config"]["url"].$darksky["config"]["key"]."/".$location["latitude"].",".$location["longitude"].$extra);
55 55
 
56 56
         $weather = json_decode($weatherJson, true);
57 57
         $page->add("weather/weather", ["location" => $location, "mapDiv" => $mapDiv, "weather" => $weather]);
58 58
 
59
-        return $page->render(["title" => $title,]);
59
+        return $page->render(["title" => $title, ]);
60 60
     }
61 61
 
62 62
     public function weatherOldActionGet()
@@ -78,20 +78,20 @@  discard block
 block discarded – undo
78 78
         $url = [];
79 79
         $extra = "?lang=sv&units=auto";
80 80
         $time  = time() - (30 * 24 * 60 * 60);
81
-        for ($i=0; $i < 31; $i++) {
82
-            $time  = time() - ($i * 24 * 60 * 60);
83
-            array_push($url, $darksky["config"]["url"]. $darksky["config"]["key"]. "/". $location["latitude"]. ",". $location["longitude"]. ",". $time. $extra);
81
+        for ($i = 0; $i < 31; $i++) {
82
+            $time = time() - ($i * 24 * 60 * 60);
83
+            array_push($url, $darksky["config"]["url"].$darksky["config"]["key"]."/".$location["latitude"].",".$location["longitude"].",".$time.$extra);
84 84
         }
85 85
 
86 86
         $mapDiv = $map->getMap($location["latitude"], $location["longitude"]);
87 87
         $weatherJson = $getJson->cUrlMulti($url);
88 88
         $weather = [];
89
-        for ($i=0; $i < count($weatherJson); $i++) {
89
+        for ($i = 0; $i < count($weatherJson); $i++) {
90 90
             array_push($weather, json_decode($weatherJson[$i], true));
91 91
         }
92 92
 
93 93
         $page->add("weather/weatherOld", ["location" => $location, "mapDiv" => $mapDiv, "weather" => $weather]);
94 94
 
95
-        return $page->render(["title" => $title,]);
95
+        return $page->render(["title" => $title, ]);
96 96
     }
97 97
 }
Please login to merge, or discard this patch.