@@ -10,205 +10,205 @@ |
||
| 10 | 10 | class Ipinfo |
| 11 | 11 | { |
| 12 | 12 | |
| 13 | - /** |
|
| 14 | - * The base url of the ipinfo service. |
|
| 15 | - * @var string |
|
| 16 | - */ |
|
| 17 | - const BASE_URL = "http://ipinfo.io/"; |
|
| 18 | - |
|
| 19 | - /** |
|
| 20 | - * The ip string. |
|
| 21 | - * @var string |
|
| 22 | - */ |
|
| 23 | - const IP = "ip"; |
|
| 24 | - |
|
| 25 | - /** |
|
| 26 | - * The hostname string. |
|
| 27 | - * @var string |
|
| 28 | - */ |
|
| 29 | - const HOSTNAME = "hostname"; |
|
| 30 | - |
|
| 31 | - /** |
|
| 32 | - * The loc string. |
|
| 33 | - * @var string |
|
| 34 | - */ |
|
| 35 | - const LOC = "loc"; |
|
| 36 | - |
|
| 37 | - /** |
|
| 38 | - * The org string. |
|
| 39 | - * @var string |
|
| 40 | - */ |
|
| 41 | - const ORG = "org"; |
|
| 42 | - |
|
| 43 | - /** |
|
| 44 | - * The city string. |
|
| 45 | - * @var string |
|
| 46 | - */ |
|
| 47 | - const CITY = "city"; |
|
| 48 | - |
|
| 49 | - /** |
|
| 50 | - * The region string. |
|
| 51 | - * @var string |
|
| 52 | - */ |
|
| 53 | - const REGION = "region"; |
|
| 54 | - |
|
| 55 | - /** |
|
| 56 | - * The country string. |
|
| 57 | - * @var string |
|
| 58 | - */ |
|
| 59 | - const COUNTRY = "country"; |
|
| 60 | - |
|
| 61 | - /** |
|
| 62 | - * The phone string. |
|
| 63 | - * @var string |
|
| 64 | - */ |
|
| 65 | - const PHONE = "phone"; |
|
| 66 | - |
|
| 67 | - /** |
|
| 68 | - * The geo string. |
|
| 69 | - * @var string |
|
| 70 | - */ |
|
| 71 | - const GEO = "geo"; |
|
| 72 | - |
|
| 73 | - /** |
|
| 74 | - * The postal string. |
|
| 75 | - * @var string |
|
| 76 | - */ |
|
| 77 | - const POSTAL = "postal"; |
|
| 78 | - |
|
| 79 | - /** |
|
| 80 | - * All the settings |
|
| 81 | - * @var array |
|
| 82 | - */ |
|
| 83 | - protected $settings; |
|
| 84 | - |
|
| 85 | - /** |
|
| 86 | - * Create an Ipinfo instance. |
|
| 87 | - * @param array $settings An array with all the settings. |
|
| 88 | - * Supported keys are: |
|
| 89 | - * - token: string the developer token; |
|
| 90 | - * - debug: boolean active or not the debug. |
|
| 91 | - */ |
|
| 92 | - public function __construct($settings = array()) |
|
| 93 | - { |
|
| 94 | - //Merge user settings |
|
| 95 | - $this->settings = array_merge(array( |
|
| 96 | - 'token' => '', |
|
| 97 | - 'debug' => false |
|
| 98 | - ), $settings); |
|
| 99 | - } |
|
| 100 | - |
|
| 101 | - |
|
| 102 | - /** |
|
| 103 | - * Get all the info about your own ip address. |
|
| 104 | - * @return \DavidePastore\Ipinfo\Host The Host object with all the info. |
|
| 105 | - */ |
|
| 106 | - public function getYourOwnIpDetails() |
|
| 107 | - { |
|
| 108 | - $response = $this->makeCurlRequest($this::BASE_URL . "json"); |
|
| 109 | - $response = json_decode($response, true); |
|
| 110 | - return new Host($response); |
|
| 111 | - } |
|
| 112 | - |
|
| 113 | - /** |
|
| 114 | - * Get all the info about an ip address. |
|
| 115 | - * @param string $ipAddress The ip address. |
|
| 116 | - * @return \DavidePastore\Ipinfo\Host The Host object with all the info. |
|
| 117 | - */ |
|
| 118 | - public function getFullIpDetails($ipAddress) |
|
| 119 | - { |
|
| 120 | - $response = $this->makeCurlRequest($this::BASE_URL . $ipAddress); |
|
| 121 | - $response = json_decode($response, true); |
|
| 122 | - return new Host($response); |
|
| 123 | - } |
|
| 124 | - |
|
| 125 | - /** |
|
| 126 | - * Get a specific field value. |
|
| 127 | - * @param string $ipAddress The ip address. |
|
| 128 | - * @param string $field The field. |
|
| 129 | - * @return string|\DavidePastore\Ipinfo\Host The value of the given field for the given ip. |
|
| 130 | - * This could returns an Host object if you call it with for the field |
|
| 131 | - * \DavidePastore\Ipinfo\Ipinfo::GEO. |
|
| 132 | - */ |
|
| 133 | - public function getSpecificField($ipAddress, $field) |
|
| 134 | - { |
|
| 135 | - $response = $this->makeCurlRequest($this::BASE_URL . $ipAddress . "/" . $field); |
|
| 136 | - $response = $this->checkGeo($field, $response); |
|
| 137 | - return $response; |
|
| 138 | - } |
|
| 139 | - |
|
| 140 | - /** |
|
| 141 | - * Get a specific field value of your own ip address. |
|
| 142 | - * @param string $field The field. |
|
| 143 | - * @return string|\DavidePastore\Ipinfo\Host The value of the given field for your own ip. |
|
| 144 | - * This could returns an Host object if you call it with for the field |
|
| 145 | - * \DavidePastore\Ipinfo\Ipinfo::GEO. |
|
| 146 | - */ |
|
| 147 | - public function getYourOwnIpSpecificField($field) |
|
| 148 | - { |
|
| 149 | - $response = $this->makeCurlRequest($this::BASE_URL . $field); |
|
| 150 | - $response = $this->checkGeo($field, $response); |
|
| 151 | - return $response; |
|
| 152 | - } |
|
| 153 | - |
|
| 154 | - /** |
|
| 155 | - * Use the /geo call to get just the geolocation information, which will often be |
|
| 156 | - * faster than getting the full response. |
|
| 157 | - * |
|
| 158 | - * @param string $ipAddress The ip address. |
|
| 159 | - * @return \DavidePastore\Ipinfo\Host |
|
| 160 | - */ |
|
| 161 | - public function getIpGeoDetails($ipAddress) |
|
| 162 | - { |
|
| 163 | - return $this->getSpecificField($ipAddress, $this::GEO); |
|
| 164 | - } |
|
| 165 | - |
|
| 166 | - /** |
|
| 167 | - * Check if the response is GEO and set the parameters accordingly. |
|
| 168 | - * @param string $field The field value. |
|
| 169 | - * @param string $response The response from the server. |
|
| 170 | - * @return Ambigous <\DavidePastore\Ipinfo\Host, string> Returns an Host object if the request is |
|
| 171 | - * of the GEO type, a string otherwise. If the field value is different from the GEO type, it will |
|
| 172 | - * delete the last character ('\n'). |
|
| 173 | - */ |
|
| 174 | - private function checkGeo($field, $response) |
|
| 175 | - { |
|
| 176 | - if ($field == $this::GEO) { |
|
| 177 | - $response = json_decode($response, true); |
|
| 178 | - $response = new Host($response); |
|
| 179 | - } else { |
|
| 180 | - $response = substr($response, 0, -1); |
|
| 181 | - } |
|
| 13 | + /** |
|
| 14 | + * The base url of the ipinfo service. |
|
| 15 | + * @var string |
|
| 16 | + */ |
|
| 17 | + const BASE_URL = "http://ipinfo.io/"; |
|
| 18 | + |
|
| 19 | + /** |
|
| 20 | + * The ip string. |
|
| 21 | + * @var string |
|
| 22 | + */ |
|
| 23 | + const IP = "ip"; |
|
| 24 | + |
|
| 25 | + /** |
|
| 26 | + * The hostname string. |
|
| 27 | + * @var string |
|
| 28 | + */ |
|
| 29 | + const HOSTNAME = "hostname"; |
|
| 30 | + |
|
| 31 | + /** |
|
| 32 | + * The loc string. |
|
| 33 | + * @var string |
|
| 34 | + */ |
|
| 35 | + const LOC = "loc"; |
|
| 36 | + |
|
| 37 | + /** |
|
| 38 | + * The org string. |
|
| 39 | + * @var string |
|
| 40 | + */ |
|
| 41 | + const ORG = "org"; |
|
| 42 | + |
|
| 43 | + /** |
|
| 44 | + * The city string. |
|
| 45 | + * @var string |
|
| 46 | + */ |
|
| 47 | + const CITY = "city"; |
|
| 48 | + |
|
| 49 | + /** |
|
| 50 | + * The region string. |
|
| 51 | + * @var string |
|
| 52 | + */ |
|
| 53 | + const REGION = "region"; |
|
| 54 | + |
|
| 55 | + /** |
|
| 56 | + * The country string. |
|
| 57 | + * @var string |
|
| 58 | + */ |
|
| 59 | + const COUNTRY = "country"; |
|
| 60 | + |
|
| 61 | + /** |
|
| 62 | + * The phone string. |
|
| 63 | + * @var string |
|
| 64 | + */ |
|
| 65 | + const PHONE = "phone"; |
|
| 66 | + |
|
| 67 | + /** |
|
| 68 | + * The geo string. |
|
| 69 | + * @var string |
|
| 70 | + */ |
|
| 71 | + const GEO = "geo"; |
|
| 72 | + |
|
| 73 | + /** |
|
| 74 | + * The postal string. |
|
| 75 | + * @var string |
|
| 76 | + */ |
|
| 77 | + const POSTAL = "postal"; |
|
| 78 | + |
|
| 79 | + /** |
|
| 80 | + * All the settings |
|
| 81 | + * @var array |
|
| 82 | + */ |
|
| 83 | + protected $settings; |
|
| 84 | + |
|
| 85 | + /** |
|
| 86 | + * Create an Ipinfo instance. |
|
| 87 | + * @param array $settings An array with all the settings. |
|
| 88 | + * Supported keys are: |
|
| 89 | + * - token: string the developer token; |
|
| 90 | + * - debug: boolean active or not the debug. |
|
| 91 | + */ |
|
| 92 | + public function __construct($settings = array()) |
|
| 93 | + { |
|
| 94 | + //Merge user settings |
|
| 95 | + $this->settings = array_merge(array( |
|
| 96 | + 'token' => '', |
|
| 97 | + 'debug' => false |
|
| 98 | + ), $settings); |
|
| 99 | + } |
|
| 100 | + |
|
| 101 | + |
|
| 102 | + /** |
|
| 103 | + * Get all the info about your own ip address. |
|
| 104 | + * @return \DavidePastore\Ipinfo\Host The Host object with all the info. |
|
| 105 | + */ |
|
| 106 | + public function getYourOwnIpDetails() |
|
| 107 | + { |
|
| 108 | + $response = $this->makeCurlRequest($this::BASE_URL . "json"); |
|
| 109 | + $response = json_decode($response, true); |
|
| 110 | + return new Host($response); |
|
| 111 | + } |
|
| 112 | + |
|
| 113 | + /** |
|
| 114 | + * Get all the info about an ip address. |
|
| 115 | + * @param string $ipAddress The ip address. |
|
| 116 | + * @return \DavidePastore\Ipinfo\Host The Host object with all the info. |
|
| 117 | + */ |
|
| 118 | + public function getFullIpDetails($ipAddress) |
|
| 119 | + { |
|
| 120 | + $response = $this->makeCurlRequest($this::BASE_URL . $ipAddress); |
|
| 121 | + $response = json_decode($response, true); |
|
| 122 | + return new Host($response); |
|
| 123 | + } |
|
| 124 | + |
|
| 125 | + /** |
|
| 126 | + * Get a specific field value. |
|
| 127 | + * @param string $ipAddress The ip address. |
|
| 128 | + * @param string $field The field. |
|
| 129 | + * @return string|\DavidePastore\Ipinfo\Host The value of the given field for the given ip. |
|
| 130 | + * This could returns an Host object if you call it with for the field |
|
| 131 | + * \DavidePastore\Ipinfo\Ipinfo::GEO. |
|
| 132 | + */ |
|
| 133 | + public function getSpecificField($ipAddress, $field) |
|
| 134 | + { |
|
| 135 | + $response = $this->makeCurlRequest($this::BASE_URL . $ipAddress . "/" . $field); |
|
| 136 | + $response = $this->checkGeo($field, $response); |
|
| 137 | + return $response; |
|
| 138 | + } |
|
| 139 | + |
|
| 140 | + /** |
|
| 141 | + * Get a specific field value of your own ip address. |
|
| 142 | + * @param string $field The field. |
|
| 143 | + * @return string|\DavidePastore\Ipinfo\Host The value of the given field for your own ip. |
|
| 144 | + * This could returns an Host object if you call it with for the field |
|
| 145 | + * \DavidePastore\Ipinfo\Ipinfo::GEO. |
|
| 146 | + */ |
|
| 147 | + public function getYourOwnIpSpecificField($field) |
|
| 148 | + { |
|
| 149 | + $response = $this->makeCurlRequest($this::BASE_URL . $field); |
|
| 150 | + $response = $this->checkGeo($field, $response); |
|
| 151 | + return $response; |
|
| 152 | + } |
|
| 153 | + |
|
| 154 | + /** |
|
| 155 | + * Use the /geo call to get just the geolocation information, which will often be |
|
| 156 | + * faster than getting the full response. |
|
| 157 | + * |
|
| 158 | + * @param string $ipAddress The ip address. |
|
| 159 | + * @return \DavidePastore\Ipinfo\Host |
|
| 160 | + */ |
|
| 161 | + public function getIpGeoDetails($ipAddress) |
|
| 162 | + { |
|
| 163 | + return $this->getSpecificField($ipAddress, $this::GEO); |
|
| 164 | + } |
|
| 165 | + |
|
| 166 | + /** |
|
| 167 | + * Check if the response is GEO and set the parameters accordingly. |
|
| 168 | + * @param string $field The field value. |
|
| 169 | + * @param string $response The response from the server. |
|
| 170 | + * @return Ambigous <\DavidePastore\Ipinfo\Host, string> Returns an Host object if the request is |
|
| 171 | + * of the GEO type, a string otherwise. If the field value is different from the GEO type, it will |
|
| 172 | + * delete the last character ('\n'). |
|
| 173 | + */ |
|
| 174 | + private function checkGeo($field, $response) |
|
| 175 | + { |
|
| 176 | + if ($field == $this::GEO) { |
|
| 177 | + $response = json_decode($response, true); |
|
| 178 | + $response = new Host($response); |
|
| 179 | + } else { |
|
| 180 | + $response = substr($response, 0, -1); |
|
| 181 | + } |
|
| 182 | 182 | |
| 183 | - return $response; |
|
| 184 | - } |
|
| 185 | - |
|
| 186 | - /** |
|
| 187 | - * Make a curl request. |
|
| 188 | - * @param string $address The address of the request. |
|
| 189 | - * @return string Returns the response from the request. |
|
| 190 | - */ |
|
| 191 | - private function makeCurlRequest($address) |
|
| 192 | - { |
|
| 193 | - $curl = curl_init(); |
|
| 183 | + return $response; |
|
| 184 | + } |
|
| 185 | + |
|
| 186 | + /** |
|
| 187 | + * Make a curl request. |
|
| 188 | + * @param string $address The address of the request. |
|
| 189 | + * @return string Returns the response from the request. |
|
| 190 | + */ |
|
| 191 | + private function makeCurlRequest($address) |
|
| 192 | + { |
|
| 193 | + $curl = curl_init(); |
|
| 194 | 194 | |
| 195 | - if (!empty($this->settings['token'])) { |
|
| 196 | - $address .= "?token=" . $this->settings['token']; |
|
| 197 | - } |
|
| 195 | + if (!empty($this->settings['token'])) { |
|
| 196 | + $address .= "?token=" . $this->settings['token']; |
|
| 197 | + } |
|
| 198 | 198 | |
| 199 | - if ($this->settings['debug']) { |
|
| 200 | - echo "Request address: " . $address . "\n"; |
|
| 201 | - } |
|
| 199 | + if ($this->settings['debug']) { |
|
| 200 | + echo "Request address: " . $address . "\n"; |
|
| 201 | + } |
|
| 202 | 202 | |
| 203 | - curl_setopt_array($curl, array( |
|
| 204 | - CURLOPT_RETURNTRANSFER => 1, |
|
| 205 | - CURLOPT_URL => $address |
|
| 206 | - )); |
|
| 203 | + curl_setopt_array($curl, array( |
|
| 204 | + CURLOPT_RETURNTRANSFER => 1, |
|
| 205 | + CURLOPT_URL => $address |
|
| 206 | + )); |
|
| 207 | 207 | |
| 208 | - $response = curl_exec($curl); |
|
| 208 | + $response = curl_exec($curl); |
|
| 209 | 209 | |
| 210 | - curl_close($curl); |
|
| 210 | + curl_close($curl); |
|
| 211 | 211 | |
| 212 | - return $response; |
|
| 213 | - } |
|
| 212 | + return $response; |
|
| 213 | + } |
|
| 214 | 214 | } |
@@ -10,113 +10,113 @@ |
||
| 10 | 10 | class Host |
| 11 | 11 | { |
| 12 | 12 | |
| 13 | - /** |
|
| 14 | - * Contains all the properties of the host. |
|
| 15 | - * @var array |
|
| 16 | - */ |
|
| 17 | - protected $properties; |
|
| 13 | + /** |
|
| 14 | + * Contains all the properties of the host. |
|
| 15 | + * @var array |
|
| 16 | + */ |
|
| 17 | + protected $properties; |
|
| 18 | 18 | |
| 19 | - /** |
|
| 20 | - * Create an Host object with all the properties. |
|
| 21 | - * @param unknown $properties |
|
| 22 | - */ |
|
| 23 | - public function __construct($properties = array()) |
|
| 24 | - { |
|
| 25 | - if (!$properties) { |
|
| 26 | - $properties = array(); |
|
| 27 | - } |
|
| 28 | - //Merge default values |
|
| 29 | - $this->properties = array_merge(array( |
|
| 30 | - Ipinfo::CITY => "", |
|
| 31 | - Ipinfo::COUNTRY => "", |
|
| 32 | - Ipinfo::HOSTNAME => "", |
|
| 33 | - Ipinfo::IP => "", |
|
| 34 | - Ipinfo::LOC => "", |
|
| 35 | - Ipinfo::ORG => "", |
|
| 36 | - Ipinfo::PHONE => "", |
|
| 37 | - Ipinfo::POSTAL => "", |
|
| 38 | - Ipinfo::REGION => "" |
|
| 39 | - ), $properties); |
|
| 40 | - } |
|
| 19 | + /** |
|
| 20 | + * Create an Host object with all the properties. |
|
| 21 | + * @param unknown $properties |
|
| 22 | + */ |
|
| 23 | + public function __construct($properties = array()) |
|
| 24 | + { |
|
| 25 | + if (!$properties) { |
|
| 26 | + $properties = array(); |
|
| 27 | + } |
|
| 28 | + //Merge default values |
|
| 29 | + $this->properties = array_merge(array( |
|
| 30 | + Ipinfo::CITY => "", |
|
| 31 | + Ipinfo::COUNTRY => "", |
|
| 32 | + Ipinfo::HOSTNAME => "", |
|
| 33 | + Ipinfo::IP => "", |
|
| 34 | + Ipinfo::LOC => "", |
|
| 35 | + Ipinfo::ORG => "", |
|
| 36 | + Ipinfo::PHONE => "", |
|
| 37 | + Ipinfo::POSTAL => "", |
|
| 38 | + Ipinfo::REGION => "" |
|
| 39 | + ), $properties); |
|
| 40 | + } |
|
| 41 | 41 | |
| 42 | - /** |
|
| 43 | - * Get the city value. |
|
| 44 | - */ |
|
| 45 | - public function getCity() |
|
| 46 | - { |
|
| 47 | - return $this->properties[Ipinfo::CITY]; |
|
| 48 | - } |
|
| 42 | + /** |
|
| 43 | + * Get the city value. |
|
| 44 | + */ |
|
| 45 | + public function getCity() |
|
| 46 | + { |
|
| 47 | + return $this->properties[Ipinfo::CITY]; |
|
| 48 | + } |
|
| 49 | 49 | |
| 50 | - /** |
|
| 51 | - * Get the country value. |
|
| 52 | - */ |
|
| 53 | - public function getCountry() |
|
| 54 | - { |
|
| 55 | - return $this->properties[Ipinfo::COUNTRY]; |
|
| 56 | - } |
|
| 50 | + /** |
|
| 51 | + * Get the country value. |
|
| 52 | + */ |
|
| 53 | + public function getCountry() |
|
| 54 | + { |
|
| 55 | + return $this->properties[Ipinfo::COUNTRY]; |
|
| 56 | + } |
|
| 57 | 57 | |
| 58 | - /** |
|
| 59 | - * Get the hostname value. |
|
| 60 | - */ |
|
| 61 | - public function getHostname() |
|
| 62 | - { |
|
| 63 | - return $this->properties[Ipinfo::HOSTNAME]; |
|
| 64 | - } |
|
| 58 | + /** |
|
| 59 | + * Get the hostname value. |
|
| 60 | + */ |
|
| 61 | + public function getHostname() |
|
| 62 | + { |
|
| 63 | + return $this->properties[Ipinfo::HOSTNAME]; |
|
| 64 | + } |
|
| 65 | 65 | |
| 66 | - /** |
|
| 67 | - * Get the ip value. |
|
| 68 | - */ |
|
| 69 | - public function getIp() |
|
| 70 | - { |
|
| 71 | - return $this->properties[Ipinfo::IP]; |
|
| 72 | - } |
|
| 66 | + /** |
|
| 67 | + * Get the ip value. |
|
| 68 | + */ |
|
| 69 | + public function getIp() |
|
| 70 | + { |
|
| 71 | + return $this->properties[Ipinfo::IP]; |
|
| 72 | + } |
|
| 73 | 73 | |
| 74 | - /** |
|
| 75 | - * Get the loc value. |
|
| 76 | - */ |
|
| 77 | - public function getLoc() |
|
| 78 | - { |
|
| 79 | - return $this->properties[Ipinfo::LOC]; |
|
| 80 | - } |
|
| 74 | + /** |
|
| 75 | + * Get the loc value. |
|
| 76 | + */ |
|
| 77 | + public function getLoc() |
|
| 78 | + { |
|
| 79 | + return $this->properties[Ipinfo::LOC]; |
|
| 80 | + } |
|
| 81 | 81 | |
| 82 | - /** |
|
| 83 | - * Get the org value. |
|
| 84 | - */ |
|
| 85 | - public function getOrg() |
|
| 86 | - { |
|
| 87 | - return $this->properties[Ipinfo::ORG]; |
|
| 88 | - } |
|
| 82 | + /** |
|
| 83 | + * Get the org value. |
|
| 84 | + */ |
|
| 85 | + public function getOrg() |
|
| 86 | + { |
|
| 87 | + return $this->properties[Ipinfo::ORG]; |
|
| 88 | + } |
|
| 89 | 89 | |
| 90 | - /** |
|
| 91 | - * Get the phone value. |
|
| 92 | - */ |
|
| 93 | - public function getPhone() |
|
| 94 | - { |
|
| 95 | - return $this->properties[Ipinfo::PHONE]; |
|
| 96 | - } |
|
| 90 | + /** |
|
| 91 | + * Get the phone value. |
|
| 92 | + */ |
|
| 93 | + public function getPhone() |
|
| 94 | + { |
|
| 95 | + return $this->properties[Ipinfo::PHONE]; |
|
| 96 | + } |
|
| 97 | 97 | |
| 98 | - /** |
|
| 99 | - * Get the postal value. |
|
| 100 | - */ |
|
| 101 | - public function getPostal() |
|
| 102 | - { |
|
| 103 | - return $this->properties[Ipinfo::POSTAL]; |
|
| 104 | - } |
|
| 98 | + /** |
|
| 99 | + * Get the postal value. |
|
| 100 | + */ |
|
| 101 | + public function getPostal() |
|
| 102 | + { |
|
| 103 | + return $this->properties[Ipinfo::POSTAL]; |
|
| 104 | + } |
|
| 105 | 105 | |
| 106 | - /** |
|
| 107 | - * Get the region value. |
|
| 108 | - */ |
|
| 109 | - public function getRegion() |
|
| 110 | - { |
|
| 111 | - return $this->properties[Ipinfo::REGION]; |
|
| 112 | - } |
|
| 106 | + /** |
|
| 107 | + * Get the region value. |
|
| 108 | + */ |
|
| 109 | + public function getRegion() |
|
| 110 | + { |
|
| 111 | + return $this->properties[Ipinfo::REGION]; |
|
| 112 | + } |
|
| 113 | 113 | |
| 114 | - /** |
|
| 115 | - * Get all the properties. |
|
| 116 | - * @return array An associative array with all the properties. |
|
| 117 | - */ |
|
| 118 | - public function getProperties() |
|
| 119 | - { |
|
| 120 | - return $this->properties; |
|
| 121 | - } |
|
| 114 | + /** |
|
| 115 | + * Get all the properties. |
|
| 116 | + * @return array An associative array with all the properties. |
|
| 117 | + */ |
|
| 118 | + public function getProperties() |
|
| 119 | + { |
|
| 120 | + return $this->properties; |
|
| 121 | + } |
|
| 122 | 122 | } |