| @@ -113,7 +113,7 @@ discard block | ||
| 113 | 113 | $apiKey = $keys["darkskyKey"]; | 
| 114 | 114 | $endStuff = '?exclude=minutely,hourly,currently,alerts,flags&extend=daily&lang=sv&units=si'; | 
| 115 | 115 | |
| 116 | -        if ($pastOrFuture=="future") { | |
| 116 | +        if ($pastOrFuture == "future") { | |
| 117 | 117 | $requestUrl = $url1 . $apiKey . "/" . $latitude . "," . $longitude . $endStuff; | 
| 118 | 118 | // $requestUrl = 'https://nominatim.openstreetmap.org/?format=json&addressdetails=1&q=bakery+in+berlin+wedding&format=json&limit=1&[email protected]'; | 
| 119 | 119 | $curl = curl_init($requestUrl); | 
| @@ -150,16 +150,16 @@ discard block | ||
| 150 | 150 | |
| 151 | 151 | |
| 152 | 152 | |
| 153 | -            for ($i=0; $i < 30; $i++) { | |
| 153 | +            for ($i = 0; $i < 30; $i++) { | |
| 154 | 154 | $unixTime = time() - ($i * 24 * 60 * 60); | 
| 155 | - $requestUrl = $url1 . $apiKey . "/" . $latitude . "," . $longitude . ','. $unixTime . $endStuff; | |
| 155 | + $requestUrl = $url1 . $apiKey . "/" . $latitude . "," . $longitude . ',' . $unixTime . $endStuff; | |
| 156 | 156 | $multiCurl[$i] = curl_init(); | 
| 157 | 157 | curl_setopt($multiCurl[$i], CURLOPT_URL, $requestUrl); | 
| 158 | 158 | curl_setopt($multiCurl[$i], CURLOPT_HEADER, 0); | 
| 159 | 159 | curl_setopt($multiCurl[$i], CURLOPT_RETURNTRANSFER, 1); | 
| 160 | 160 | curl_multi_add_handle($mhbutlonger, $multiCurl[$i]); | 
| 161 | 161 | } | 
| 162 | - $index=null; | |
| 162 | + $index = null; | |
| 163 | 163 |              do { | 
| 164 | 164 | curl_multi_exec($mhbutlonger, $index); | 
| 165 | 165 | } while ($index > 0); | 
| @@ -177,12 +177,12 @@ discard block | ||
| 177 | 177 | // $anArray = []; | 
| 178 | 178 | // $data = []; | 
| 179 | 179 | $data2 = []; | 
| 180 | - $i=0; | |
| 180 | + $i = 0; | |
| 181 | 181 |              foreach ($response as $item) { | 
| 182 | 182 | $data = json_decode($item, true); | 
| 183 | 183 | $data2[$i] = $data['daily']['data'][0]; | 
| 184 | 184 | // $data[$i] = $item; | 
| 185 | - $i=$i+1; | |
| 185 | + $i = $i + 1; | |
| 186 | 186 | } | 
| 187 | 187 | // $daily['data'] = $data; | 
| 188 | 188 | // $anArray['daily'] = $daily; | 
| @@ -236,7 +236,7 @@ discard block | ||
| 236 | 236 | $weather2 = []; | 
| 237 | 237 | $locale = 'sv_SE.utf8'; | 
| 238 | 238 | setlocale(LC_TIME, $locale); | 
| 239 | - $i=0; | |
| 239 | + $i = 0; | |
| 240 | 240 |          foreach ($weather as $day) { | 
| 241 | 241 | // array_push($weather2, $day['time']); | 
| 242 | 242 | $unixTimestamp = $day['time']; | 
| @@ -258,7 +258,7 @@ discard block | ||
| 258 | 258 | $weather2[$i]['windSpeed'] = round($day['windSpeed']); | 
| 259 | 259 | $weather2[$i]['windBearing'] = $day['windBearing']; | 
| 260 | 260 | // array_push($weather2, $datetime2); | 
| 261 | - $i=$i+1; | |
| 261 | + $i = $i + 1; | |
| 262 | 262 | } | 
| 263 | 263 | return $weather2; | 
| 264 | 264 | } |