diff --git a/src/IPStack/GeoLookup.php b/src/IPStack/GeoLookup.php index 0722918..42b548b 100644 --- a/src/IPStack/GeoLookup.php +++ b/src/IPStack/GeoLookup.php @@ -35,21 +35,21 @@ class GeoLookup /** * Whether or not to attempt reverse hostname lookup when * looking up location data. - * + * * @var bool */ private $find_hostname = false; /** * Whether or not to assess the security of an IP address. - * + * * @var bool */ private $assess_security = false; /** * The language to translate the response into. - * + * * @var string */ private $language = 'en'; @@ -60,7 +60,8 @@ class GeoLookup * * @param string $api_key Your IPStack API Key. */ - public function __construct(string $api_key) { + public function __construct(string $api_key) + { $this->api_key = $api_key; } @@ -87,8 +88,8 @@ public function getLocation(string $ip) ]))->get( $ip.'?access_key='.$this->api_key. '&output=json'. - ($this->find_hostname?'&hostname=1':''). - ($this->assess_security?'&security=1':''). + ($this->find_hostname ? '&hostname=1' : ''). + ($this->assess_security ? '&security=1' : ''). '&language='.$this->language ); @@ -134,8 +135,8 @@ public function getLocations(string ...$ips) ]))->get( implode(',', $ips).'?access_key='.$this->api_key. '&output=json'. - ($this->find_hostname?'&hostname=1':''). - ($this->assess_security?'&security=1':''). + ($this->find_hostname ? '&hostname=1' : ''). + ($this->assess_security ? '&security=1' : ''). '&language='.$this->language ); @@ -156,7 +157,7 @@ public function getLocations(string ...$ips) /** * Retrieve the location information for the system executing this code. - * + * * @return array|null * @throws \Exception */ @@ -175,8 +176,8 @@ public function getOwnLocation() ]))->get( 'check?access_key='.$this->api_key. '&output=json'. - ($this->find_hostname?'&hostname=1':''). - ($this->assess_security?'&security=1':''). + ($this->find_hostname ? '&hostname=1' : ''). + ($this->assess_security ? '&security=1' : ''). '&language='.$this->language ); @@ -217,7 +218,7 @@ public function getClientLocation() * Set whether or not to attempt reverse hostname lookup when * looking up location data. * - * @var bool $value The new value. + * @param bool $value The new value. * * @see https://ipstack.com/documentation#hostname * @return \IPStack\PHP\GeoLookup @@ -243,7 +244,7 @@ public function getFindHostname() /** * Set whether or not to use HTTPS with this connection. * - * @var bool $value The new value. + * @param bool $value The new value. * * @return \IPStack\PHP\GeoLookup */ @@ -267,7 +268,7 @@ public function isUsingHttps() /** * Set whether or not to assess the security of an IP address. * - * @var bool $value The new value. + * @param bool $value The new value. * * @see https://ipstack.com/documentation#security * @return \IPStack\PHP\GeoLookup @@ -292,7 +293,7 @@ public function isAssessingSecurity() /** * Set the timeout for connections. * - * @var int $value The new value. + * @param int $value The new value. * * @return \IPStack\PHP\GeoLookup */ @@ -303,10 +304,19 @@ public function setTimeout(int $value) return $this; } + /** + * Get the timeout for connections. + * + * @return int + */ + public function getTimeout() { + return $this->timeout; + } + /** * Specify the language that the response should be translated into. * - * @var int $value The new language. + * @param int $value The new language. * * @see https://ipstack.com/documentation#language * @return \IPStack\PHP\GeoLookup @@ -327,13 +337,4 @@ public function getLanguage() { return $this->language; } - - /** - * Get the timeout for connections. - * - * @return int - */ - public function getTimeout() { - return $this->timeout; - } }