@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | public function resultActionGet() |
| 42 | 42 | { |
| 43 | 43 | $ipn = $this->di->get("request")->getGet("ipnummer"); |
| 44 | - $res =[]; |
|
| 44 | + $res = []; |
|
| 45 | 45 | |
| 46 | 46 | $paraply = new \KW\Models\IpUmbrella($this->di); |
| 47 | 47 | $res = $paraply->input($ipn); |
@@ -59,15 +59,15 @@ discard block |
||
| 59 | 59 | public function indexActionPost() : array |
| 60 | 60 | { |
| 61 | 61 | $ipn = $this->di->get("request")->getPost("ipnummer"); |
| 62 | - $res =[]; |
|
| 62 | + $res = []; |
|
| 63 | 63 | $paraply = new \KW\Models\IpUmbrella($this->di); |
| 64 | 64 | $res = $paraply->input($ipn); |
| 65 | 65 | |
| 66 | 66 | if ($res["latitude"]) { |
| 67 | 67 | $res["url-link"] = "https://www.openstreetmap.org/?mlat=" |
| 68 | - . $res["latitude"]. "&mlon=" |
|
| 69 | - . $res["longitude"] ."&zoom=12#map=12/" |
|
| 70 | - . $res["latitude"] ."/" |
|
| 68 | + . $res["latitude"] . "&mlon=" |
|
| 69 | + . $res["longitude"] . "&zoom=12#map=12/" |
|
| 70 | + . $res["latitude"] . "/" |
|
| 71 | 71 | . $res["longitude"]; |
| 72 | 72 | } else { |
| 73 | 73 | $res["url-link"] = null; |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | "message" => "Not a valid ip-number" |
| 47 | 47 | ]; |
| 48 | 48 | } else { |
| 49 | - $type = (filter_var($ipn, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) ? "ipv4" : "ipv6" ); |
|
| 49 | + $type = (filter_var($ipn, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) ? "ipv4" : "ipv6"); |
|
| 50 | 50 | $domainname = gethostbyaddr($ipn); |
| 51 | 51 | |
| 52 | 52 | $domainname = ($domainname == $ipn ? "none" : $domainname); |
@@ -19,9 +19,9 @@ |
||
| 19 | 19 | { |
| 20 | 20 | $days = []; |
| 21 | 21 | $mapUrl = "https://www.openstreetmap.org/?mlat=" |
| 22 | - . $res["latitude"]. "&mlon=" |
|
| 23 | - . $res["longitude"] ."&zoom=12#map=12/" |
|
| 24 | - . $res["latitude"] ."/" |
|
| 22 | + . $res["latitude"] . "&mlon=" |
|
| 23 | + . $res["longitude"] . "&zoom=12#map=12/" |
|
| 24 | + . $res["latitude"] . "/" |
|
| 25 | 25 | . $res["longitude"]; |
| 26 | 26 | |
| 27 | 27 | $type = ($res["type"] == "past" ? "past mounth" : "future week"); |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | |
| 22 | 22 | public function weather($longitude, $latitude, $type) |
| 23 | 23 | { |
| 24 | - if ($type=="future") { |
|
| 24 | + if ($type == "future") { |
|
| 25 | 25 | $url = ($this->baseUrl . $this->darkSkyKey . "/" . $latitude . "," . $longitude . $this->apiSettings); |
| 26 | 26 | $cURL = new CURL; |
| 27 | 27 | $result = $cURL->req($url); |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | $this->wobj["error"] = "Du måste ange korrekt longitud och latitud om ipnummer ej anges!"; |
| 63 | 63 | return $this->wobj; |
| 64 | 64 | } |
| 65 | - $this->wobj["latitude"]= $latitude; |
|
| 65 | + $this->wobj["latitude"] = $latitude; |
|
| 66 | 66 | $this->wobj["longitude"] = $longitude; |
| 67 | 67 | list($this->wobj["country"], $this->wobj["city"]) = $this->osmr->osmCheckCoordinates($longitude, $latitude); |
| 68 | 68 | } |
@@ -29,12 +29,12 @@ discard block |
||
| 29 | 29 | $datum = time(); |
| 30 | 30 | |
| 31 | 31 | // create all cURL resources |
| 32 | - for ($i=0; $i < 30; $i++) { |
|
| 32 | + for ($i = 0; $i < 30; $i++) { |
|
| 33 | 33 | $chh[$i] = curl_init(); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | // set URL and other appropriate options |
| 37 | - for ($i=0; $i < 30; $i++) { |
|
| 37 | + for ($i = 0; $i < 30; $i++) { |
|
| 38 | 38 | $aktuellsekund = $datum - 30*86400 + $i*86400; |
| 39 | 39 | $url = ($this->baseUrl . $this->darkSkyKey . "/" . $latitude . "," . $longitude . "," . $aktuellsekund . $this->apiSettings); |
| 40 | 40 | // create all cURL resources |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | $mhh = curl_multi_init(); |
| 48 | 48 | |
| 49 | 49 | //add the handles |
| 50 | - for ($i=0; $i < 30; $i++) { |
|
| 50 | + for ($i = 0; $i < 30; $i++) { |
|
| 51 | 51 | curl_multi_add_handle($mhh, $chh[$i]); |
| 52 | 52 | } |
| 53 | 53 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | curl_multi_close($mhh); |
| 68 | 68 | |
| 69 | - for ($i=0; $i < 30; $i++) { |
|
| 69 | + for ($i = 0; $i < 30; $i++) { |
|
| 70 | 70 | if (isset($svar[$i]->daily->data[0])) { |
| 71 | 71 | $result['daily']['data'][$i] = $svar[$i]->daily->data[0]; |
| 72 | 72 | } else { |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | */ |
| 12 | 12 | public function ipType(string $ipnumber) |
| 13 | 13 | { |
| 14 | - $type = (filter_var($ipnumber, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) ? "ipv4" : "ipv6" ); |
|
| 14 | + $type = (filter_var($ipnumber, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) ? "ipv4" : "ipv6"); |
|
| 15 | 15 | // $domainname = gethostbyaddr($ipnumber); |
| 16 | 16 | // $domainname = ($domainname == $ipnumber ? "none" : $domainname); |
| 17 | 17 | return $type; |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | "jsonWeather" => [ |
| 10 | 10 | "shared" => true, |
| 11 | 11 | "active" => true, |
| 12 | - "callback" => function () { |
|
| 12 | + "callback" => function() { |
|
| 13 | 13 | $obj = new \KW\Models\JsonWeather(); |
| 14 | 14 | return $obj; |
| 15 | 15 | } |
@@ -7,7 +7,7 @@ |
||
| 7 | 7 | "services" => [ |
| 8 | 8 | "request" => [ |
| 9 | 9 | "shared" => true, |
| 10 | - "callback" => function () { |
|
| 10 | + "callback" => function() { |
|
| 11 | 11 | $obj = new \Anax\Request\Request(); |
| 12 | 12 | $obj->init(); |
| 13 | 13 | return $obj; |