| @@ -115,7 +115,7 @@ discard block | ||
| 115 | 115 | $apiKey = $keys["darkskyKey"]; | 
| 116 | 116 | $endStuff = '?exclude=minutely,hourly,currently,alerts,flags&extend=daily&lang=sv&units=si'; | 
| 117 | 117 | |
| 118 | -        if ($pastOrFuture=="future") { | |
| 118 | +        if ($pastOrFuture == "future") { | |
| 119 | 119 | $requestUrl = $url1 . $apiKey . "/" . $latitude . "," . $longitude . $endStuff; | 
| 120 | 120 | // $requestUrl = 'https://nominatim.openstreetmap.org/?format=json&addressdetails=1&q=bakery+in+berlin+wedding&format=json&limit=1&[email protected]'; | 
| 121 | 121 | $curl = curl_init($requestUrl); | 
| @@ -154,16 +154,16 @@ discard block | ||
| 154 | 154 | |
| 155 | 155 | |
| 156 | 156 | |
| 157 | -            for ($i=0; $i < 3; $i++) { | |
| 157 | +            for ($i = 0; $i < 3; $i++) { | |
| 158 | 158 | $unixTime = time() - ($i * 24 * 60 * 60); | 
| 159 | - $requestUrl = $url1 . $apiKey . "/" . $latitude . "," . $longitude . ','. $unixTime . $endStuff; | |
| 159 | + $requestUrl = $url1 . $apiKey . "/" . $latitude . "," . $longitude . ',' . $unixTime . $endStuff; | |
| 160 | 160 | $multiCurl[$i] = curl_init(); | 
| 161 | 161 | curl_setopt($multiCurl[$i], CURLOPT_URL, $requestUrl); | 
| 162 | 162 | curl_setopt($multiCurl[$i], CURLOPT_HEADER, 0); | 
| 163 | 163 | curl_setopt($multiCurl[$i], CURLOPT_RETURNTRANSFER, 1); | 
| 164 | 164 | curl_multi_add_handle($mhbutlonger, $multiCurl[$i]); | 
| 165 | 165 | } | 
| 166 | - $index=null; | |
| 166 | + $index = null; | |
| 167 | 167 |              do { | 
| 168 | 168 | curl_multi_exec($mhbutlonger, $index); | 
| 169 | 169 | } while ($index > 0); | 
| @@ -181,12 +181,12 @@ discard block | ||
| 181 | 181 | // $anArray = []; | 
| 182 | 182 | // $data = []; | 
| 183 | 183 | $data2 = []; | 
| 184 | - $i=0; | |
| 184 | + $i = 0; | |
| 185 | 185 |              foreach ($response as $item) { | 
| 186 | 186 | $data = json_decode($item, true); | 
| 187 | 187 | $data2[$i] = $data['daily']['data'][0]; | 
| 188 | 188 | // $data[$i] = $item; | 
| 189 | - $i=$i+1; | |
| 189 | + $i = $i + 1; | |
| 190 | 190 | } | 
| 191 | 191 | // $daily['data'] = $data; | 
| 192 | 192 | // $anArray['daily'] = $daily; | 
| @@ -240,7 +240,7 @@ discard block | ||
| 240 | 240 | $weather2 = []; | 
| 241 | 241 | $locale = 'sv_SE.utf8'; | 
| 242 | 242 | setlocale(LC_TIME, $locale); | 
| 243 | - $i=0; | |
| 243 | + $i = 0; | |
| 244 | 244 |          foreach ($weather as $day) { | 
| 245 | 245 | // array_push($weather2, $day['time']); | 
| 246 | 246 | $unixTimestamp = $day['time']; | 
| @@ -262,7 +262,7 @@ discard block | ||
| 262 | 262 | $weather2[$i]['windSpeed'] = round($day['windSpeed']); | 
| 263 | 263 | $weather2[$i]['windBearing'] = $day['windBearing']; | 
| 264 | 264 | // array_push($weather2, $datetime2); | 
| 265 | - $i=$i+1; | |
| 265 | + $i = $i + 1; | |
| 266 | 266 | } | 
| 267 | 267 | return $weather2; | 
| 268 | 268 | } |