@@ -34,10 +34,10 @@ |
||
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | - * Return status of given ip-number |
|
| 38 | - * |
|
| 39 | - * @return object |
|
| 40 | - */ |
|
| 37 | + * Return status of given ip-number |
|
| 38 | + * |
|
| 39 | + * @return object |
|
| 40 | + */ |
|
| 41 | 41 | public function resultActionGet() |
| 42 | 42 | { |
| 43 | 43 | $ipn = $this->di->get("request")->getGet("ipnummer"); |
@@ -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; |
@@ -32,10 +32,10 @@ |
||
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | - * Return status of given ip-number |
|
| 36 | - * |
|
| 37 | - * @return object |
|
| 38 | - */ |
|
| 35 | + * Return status of given ip-number |
|
| 36 | + * |
|
| 37 | + * @return object |
|
| 38 | + */ |
|
| 39 | 39 | public function ipnummerActionGet() |
| 40 | 40 | { |
| 41 | 41 | //$ipn = $this->di->request->getGet("ipnummer"); |
@@ -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); |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | "message" => "Not a valid ip-number" |
| 29 | 29 | ]; |
| 30 | 30 | } else { |
| 31 | - $type = (filter_var($ipn, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) ? "ipv4" : "ipv6" ); |
|
| 31 | + $type = (filter_var($ipn, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) ? "ipv4" : "ipv6"); |
|
| 32 | 32 | $domainname = gethostbyaddr($ipn); |
| 33 | 33 | |
| 34 | 34 | $domainname = ($domainname == $ipn ? "none" : $domainname); |
@@ -42,10 +42,10 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | |
| 44 | 44 | /** |
| 45 | - * Return weather from darkSky |
|
| 46 | - * |
|
| 47 | - * @return object |
|
| 48 | - */ |
|
| 45 | + * Return weather from darkSky |
|
| 46 | + * |
|
| 47 | + * @return object |
|
| 48 | + */ |
|
| 49 | 49 | public function resultActionGet() |
| 50 | 50 | { |
| 51 | 51 | $longitude = null; |
@@ -74,10 +74,10 @@ discard block |
||
| 74 | 74 | |
| 75 | 75 | |
| 76 | 76 | /** |
| 77 | - * Return weather from restfully |
|
| 78 | - * |
|
| 79 | - * @return object |
|
| 80 | - */ |
|
| 77 | + * Return weather from restfully |
|
| 78 | + * |
|
| 79 | + * @return object |
|
| 80 | + */ |
|
| 81 | 81 | public function restActionGet() : array |
| 82 | 82 | { |
| 83 | 83 | $longitude = null; |
@@ -5,8 +5,8 @@ |
||
| 5 | 5 | class CURL |
| 6 | 6 | { |
| 7 | 7 | /** |
| 8 | - * @var array $objekt som api:et returnerar |
|
| 9 | - */ |
|
| 8 | + * @var array $objekt som api:et returnerar |
|
| 9 | + */ |
|
| 10 | 10 | |
| 11 | 11 | public function req(string $url) |
| 12 | 12 | { |
@@ -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); |
@@ -6,8 +6,8 @@ |
||
| 6 | 6 | { |
| 7 | 7 | |
| 8 | 8 | /** |
| 9 | - * @var array $ipobjekt array med info om ett ipnummer |
|
| 10 | - */ |
|
| 9 | + * @var array $ipobjekt array med info om ett ipnummer |
|
| 10 | + */ |
|
| 11 | 11 | |
| 12 | 12 | public $ipobject = array( |
| 13 | 13 | "number" => "", |
@@ -6,8 +6,8 @@ |
||
| 6 | 6 | { |
| 7 | 7 | |
| 8 | 8 | /** |
| 9 | - * @var array $wobj array med info om ett ipnummer, koordinater samt ev väderresultat |
|
| 10 | - */ |
|
| 9 | + * @var array $wobj array med info om ett ipnummer, koordinater samt ev väderresultat |
|
| 10 | + */ |
|
| 11 | 11 | |
| 12 | 12 | public $wobj = array( |
| 13 | 13 | "ip"=>"", |
@@ -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 | } |