httpClient = $httpClient; } /** * @param $ipAddress * @return array */ public function resolveIpLocation($ipAddress) { try { $response = $this->httpClient->get(sprintf(self::SERVICE_PATTERN, $ipAddress)); return json_decode($response->getBody(), true); } catch (GuzzleException $e) { throw WrongIpException::fromIpAddress($ipAddress, $e); } } }