Skip to content

Commit

Permalink
Fixed StyleCI: Stage 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Fiscaletti committed Jun 27, 2019
1 parent 943dfca commit eb65efc
Showing 1 changed file with 26 additions and 25 deletions.
51 changes: 26 additions & 25 deletions src/IPStack/GeoLookup.php
Expand Up @@ -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';
Expand All @@ -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;
}

Expand All @@ -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
);

Expand Down Expand Up @@ -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
);

Expand All @@ -156,7 +157,7 @@ public function getLocations(string ...$ips)

/**
* Retrieve the location information for the system executing this code.
*
*
* @return array|null
* @throws \Exception
*/
Expand All @@ -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
);

Expand Down Expand Up @@ -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
Expand All @@ -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
*/
Expand All @@ -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
Expand All @@ -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
*/
Expand All @@ -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
Expand All @@ -327,13 +337,4 @@ public function getLanguage()
{
return $this->language;
}

/**
* Get the timeout for connections.
*
* @return int
*/
public function getTimeout() {
return $this->timeout;
}
}

0 comments on commit eb65efc

Please sign in to comment.