| @@ 108-119 (lines=12) @@ | ||
| 105 | ||
| 106 | return null; | |
| 107 | ||
| 108 | case (self::PROVIDER_IPINFO_IO): | |
| 109 |                 if (@strlen(trim($geoData->country)) == 2) { | |
| 110 |                     switch ($type) { | |
| 111 | case (self::TYPE_FULL_OBJECT): | |
| 112 | return $geoData; | |
| 113 | case (self::TYPE_FULL_ARRAY): | |
| 114 | return @json_decode($response, true); | |
| 115 | default: | |
| 116 |                             throw new LocationDetectorException("Invalid return type."); | |
| 117 | } | |
| 118 | } | |
| 119 | ||
| 120 | return null; | |
| 121 | ||
| 122 | case (self::PROVIDER_FREEGEOIP_IO): | |
| @@ 122-133 (lines=12) @@ | ||
| 119 | ||
| 120 | return null; | |
| 121 | ||
| 122 | case (self::PROVIDER_FREEGEOIP_IO): | |
| 123 |                 if (@strlen(trim($geoData->country_code)) == 2) { | |
| 124 |                     switch ($type) { | |
| 125 | case (self::TYPE_FULL_OBJECT): | |
| 126 | return $geoData; | |
| 127 | case (self::TYPE_FULL_ARRAY): | |
| 128 | return @json_decode($response, true); | |
| 129 | default: | |
| 130 |                             throw new LocationDetectorException("Invalid return type."); | |
| 131 | } | |
| 132 | } | |
| 133 | ||
| 134 | return null; | |
| 135 | } | |
| 136 | } | |