@@ -25,7 +25,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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"); |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | <p class="lead">H <?= round($day["temperatureHigh"]) ?>°</p> |
| 88 | 88 | <p class="lead">L <?= round($day["temperatureLow"]) ?>°</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 |
||
| 105 | 105 | <p class="lead">H <?= round($day["temperatureHigh"]) ?>°</p> |
| 106 | 106 | <p class="lead">L <?= round($day["temperatureLow"]) ?>°</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; ?> |
@@ -7,7 +7,7 @@ |
||
| 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 | } |