src/IPinfo.php
public function formatDetailsObject($details = [])
    {
      $country = $details['country'] ?? null;
      $details['country_name'] = $this->countries[$country] ?? null;

      if (array_key_exists('loc', $details)) {
        $coords = explode(',', $details['loc']);
        $details['latitude'] = $coords[0];
        $details['longitude'] = $coords[1];
      } else {
        $details['latitude'] = null;
        $details['longitude'] = null;
      }

      return new Details($details);
    }
public function formatDetailsObject($details = [])
    {
      $country = $details['country'] ?? null;
      $details['country_name'] = $this->countries[$country] ?? null;

      if (array_key_exists('loc', $details)) {
        $coords = explode(',', $details['loc']);
        $details['latitude'] = $coords[0];
        $details['longitude'] = $coords[1];
      } else {
        $details['latitude'] = null;
        $details['longitude'] = null;
      }

      return new Details($details);
    }
Format details and return as an object.
@param  array  $details IP address details.
@return Details Formatted IPinfo Details object.