@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | $page->add("weatherapi/weather", $data); |
| 47 | 47 | |
| 48 | 48 | return $page->render([ |
| 49 | - "title" => $title, |
|
| 49 | + "title" => $title, |
|
| 50 | 50 | ]); |
| 51 | 51 | } |
| 52 | 52 | public function weatherDataAction() : object |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | $page->add("weatherapi/weather-data", $data); |
| 70 | 70 | |
| 71 | 71 | return $page->render([ |
| 72 | - "title" => $title, |
|
| 72 | + "title" => $title, |
|
| 73 | 73 | ]); |
| 74 | 74 | } |
| 75 | 75 | /** |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | $page->add("weatherapi/weather-json", $data); |
| 46 | 46 | |
| 47 | 47 | return $page->render([ |
| 48 | - "title" => $title, |
|
| 48 | + "title" => $title, |
|
| 49 | 49 | ]); |
| 50 | 50 | } |
| 51 | 51 | /** |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | $json = []; |
| 67 | 67 | |
| 68 | 68 | // Initialize CURL: |
| 69 | - $ch = curl_init('http://api.ipstack.com/'. $ip . '?access_key=' . $this->apikey1 . ''); |
|
| 69 | + $ch = curl_init('http://api.ipstack.com/' . $ip . '?access_key=' . $this->apikey1 . ''); |
|
| 70 | 70 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
| 71 | 71 | |
| 72 | 72 | // Store the data: |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | $location = $coords["lat"] . ',' . $coords["long"]; |
| 95 | 95 | |
| 96 | 96 | // Initialize CURL: |
| 97 | - $ch = curl_init('https://api.darksky.net/forecast/'.$this->apikey2.'/'.$location.'?exclude=minutely,hourly,currently,alerts,flags&extend=daily&lang=sv&units=ca'); |
|
| 97 | + $ch = curl_init('https://api.darksky.net/forecast/' . $this->apikey2 . '/' . $location . '?exclude=minutely,hourly,currently,alerts,flags&extend=daily&lang=sv&units=ca'); |
|
| 98 | 98 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
| 99 | 99 | |
| 100 | 100 | // Store the data: |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | $location = $coords["lat"] . ',' . $coords["long"]; |
| 157 | 157 | for ($i = 0; $i < $days; $i++) { |
| 158 | 158 | $time = $this->getDayFormat("$i"); |
| 159 | - $urls[] = 'https://api.darksky.net/forecast/'.$this->apikey2.'/'.$location.','.$time.'?exclude=minutely,hourly,currently,alerts,flags&extend=daily&lang=sv&units=auto'; |
|
| 159 | + $urls[] = 'https://api.darksky.net/forecast/' . $this->apikey2 . '/' . $location . ',' . $time . '?exclude=minutely,hourly,currently,alerts,flags&extend=daily&lang=sv&units=auto'; |
|
| 160 | 160 | } |
| 161 | 161 | return $urls; |
| 162 | 162 | } |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | public function getDayFormat($day) |
| 168 | 168 | { |
| 169 | 169 | $date = new \Datetime(); |
| 170 | - $date->sub(new \DateInterval('P'. (intval($day) + 1) .'D')); |
|
| 170 | + $date->sub(new \DateInterval('P' . (intval($day) + 1) . 'D')); |
|
| 171 | 171 | return $date->format('U'); |
| 172 | 172 | } |
| 173 | 173 | |
@@ -21,5 +21,5 @@ |
||
| 21 | 21 | <pre><?= var_dump($session) ?></pre> |
| 22 | 22 | |
| 23 | 23 | <p> |
| 24 | - <a href="<?= url($mount."session") ?>">Back to session<a> |
|
| 24 | + <a href="<?= url($mount . "session") ?>">Back to session<a> |
|
| 25 | 25 | </p> |