Completed
Push — master ( 8d3452...d83710 )
by Martin
03:23
created
view/weather/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
             <p class="lead">H <?= round($day["temperatureHigh"]) ?>&deg;</p>
88 88
             <p class="lead">L <?= round($day["temperatureLow"]) ?>&deg;</p>
89 89
           </div>
90
-          <p class="lead m-0">Luftfuktighet <?= $day["humidity"]*100 ?>%</p>
90
+          <p class="lead m-0">Luftfuktighet <?= $day["humidity"] * 100 ?>%</p>
91 91
         </div>
92 92
       </div>
93 93
         <?php endforeach; ?>
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
             <p class="lead">H <?= round($day["temperatureHigh"]) ?>&deg;</p>
106 106
             <p class="lead">L <?= round($day["temperatureLow"]) ?>&deg;</p>
107 107
           </div>
108
-          <p class="lead m-0">Luftfuktighet <?= $day["humidity"]*100 ?>%</p>
108
+          <p class="lead m-0">Luftfuktighet <?= $day["humidity"] * 100 ?>%</p>
109 109
         </div>
110 110
       </div>
111 111
         <?php endforeach; ?>
Please login to merge, or discard this patch.
config/di/weather.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
     "services" => [
8 8
         "weather" => [
9 9
             "shared" => true,
10
-            "callback" => function () {
10
+            "callback" => function() {
11 11
                 $weather = new \Anax\Weather\WeatherModel;
12 12
                 return $weather;
13 13
             }
Please login to merge, or discard this patch.
src/Weather/WeatherModel.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
      */
26 26
     public function __construct()
27 27
     {
28
-        $prep = require ANAX_INSTALL_PATH . "/config/keys.php";
28
+        $prep = require ANAX_INSTALL_PATH."/config/keys.php";
29 29
         $this->apiKey = $prep["darksky"];
30 30
     }
31 31
 
@@ -43,11 +43,11 @@  discard block
 block discarded – undo
43 43
         }
44 44
 
45 45
         $accessKey = $this->apiKey;
46
-        $location = $coords[0]['lat'] . ',' . $coords[0]['lon'];
46
+        $location = $coords[0]['lat'].','.$coords[0]['lon'];
47 47
 
48 48
         $chA = curl_init(
49 49
             'https://api.darksky.net/forecast/'.
50
-            $accessKey . '/' . $location.
50
+            $accessKey.'/'.$location.
51 51
             '?exclude=minutely,hourly,currently,alerts,flags&extend=daily&lang=sv&units=auto'
52 52
         );
53 53
         curl_setopt($chA, CURLOPT_RETURNTRANSFER, true);
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
     public function getDate($nrOfDays) : string
69 69
     {
70 70
         $myDate = new \Datetime();
71
-        $myDate->sub(new \DateInterval('P'. (intval($nrOfDays) + 1) .'D'));
71
+        $myDate->sub(new \DateInterval('P'.(intval($nrOfDays) + 1).'D'));
72 72
         return $myDate->format('U');
73 73
     }
74 74
 
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 
179 179
         $urls = [];
180 180
         $accessKey = $this->getKey();
181
-        $location = $coords[0]['lat'] . ',' . $coords[0]['lon'];
181
+        $location = $coords[0]['lat'].','.$coords[0]['lon'];
182 182
 
183 183
         for ($i = 0; $i < $nrOfDays; $i++) {
184 184
             $time = $this->getDate("$i");
Please login to merge, or discard this patch.
src/Controller/WeatherController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
         $weather = $this->di->get("weather");
47 47
         $test = $session->get('test');
48 48
         $page->add(
49
-            ANAX_INSTALL_PATH . "/view/weather/index", // "anax/v2/weather/index"
49
+            ANAX_INSTALL_PATH."/view/weather/index", // "anax/v2/weather/index"
50 50
             [
51 51
                 "jsonData" => $session->get('jsonData'),
52 52
                 "locationData" => $session->get('locationData'),
Please login to merge, or discard this patch.