| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 4 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 6 | 4 | public function getCountry($visitorAddress) |
|
| 7 | { |
||
| 8 | 4 | if (!function_exists("geoip_country_code_by_name")) { |
|
| 9 | // @codeCoverageIgnoreStart |
||
| 10 | throw new \InvalidArgumentException("It seems, the geo-ip extension is not installed for php."); |
||
| 11 | // @codeCoverageIgnoreEnd |
||
| 12 | } |
||
| 13 | 4 | $counrtyCode = @\geoip_country_code_by_name($visitorAddress); |
|
| 14 | |||
| 15 | 4 | return $counrtyCode; |
|
| 16 | } |
||
| 17 | } |
||
| 18 |