Completed
Push — master ( 428b59...e3f574 )
by Martin
02:30
created
Category
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
 
@@ -44,11 +44,11 @@  discard block
 block discarded – undo
44 44
 
45 45
         /* $filename = __DIR__ . "/key.txt"; */
46 46
         $accessKey = $this->apiKey;
47
-        $location = $coords[0]['lat'] . ',' . $coords[0]['lon'];
47
+        $location = $coords[0]['lat'].','.$coords[0]['lon'];
48 48
 
49 49
         $chA = curl_init(
50 50
             'https://api.darksky.net/forecast/'.
51
-            $accessKey . '/' . $location.
51
+            $accessKey.'/'.$location.
52 52
             '?exclude=minutely,hourly,currently,alerts,flags&extend=daily&lang=sv&units=auto'
53 53
         );
54 54
         curl_setopt($chA, CURLOPT_RETURNTRANSFER, true);
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
     public function getDate($nrOfDays) : string
70 70
     {
71 71
         $myDate = new \Datetime();
72
-        $myDate->sub(new \DateInterval('P'. (intval($nrOfDays) + 1) .'D'));
72
+        $myDate->sub(new \DateInterval('P'.(intval($nrOfDays) + 1).'D'));
73 73
         return $myDate->format('U');
74 74
     }
75 75
 
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 
180 180
         $urls = [];
181 181
         $accessKey = $this->getKey();
182
-        $location = $coords[0]['lat'] . ',' . $coords[0]['lon'];
182
+        $location = $coords[0]['lat'].','.$coords[0]['lon'];
183 183
 
184 184
         for ($i = 0; $i < $nrOfDays; $i++) {
185 185
             $time = $this->getDate("$i");
Please login to merge, or discard this patch.
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.