Fixed all possible PHPStan errors

This commit is contained in:
Alejandro Celaya
2017-12-27 16:23:54 +01:00
parent 4f3995ea80
commit db956a1f40
21 changed files with 67 additions and 68 deletions

View File

@@ -22,15 +22,17 @@ class IpLocationResolver implements IpLocationResolverInterface
}
/**
* @param $ipAddress
* @param string $ipAddress
* @return array
* @throws WrongIpException
*/
public function resolveIpLocation($ipAddress)
public function resolveIpLocation(string $ipAddress): array
{
try {
$response = $this->httpClient->get(sprintf(self::SERVICE_PATTERN, $ipAddress));
return json_decode((string) $response->getBody(), true);
} catch (GuzzleException $e) {
/** @var \Throwable $e */
throw WrongIpException::fromIpAddress($ipAddress, $e);
}
}