Created an EmptyIpLocationResolver which always returns an empty resolution and can be used as a fallback while resolving IP addresses

This commit is contained in:
Alejandro Celaya
2018-11-12 20:58:14 +01:00
parent 1aa78f766a
commit c7339f6cfa
7 changed files with 78 additions and 8 deletions

View File

@@ -0,0 +1,25 @@
<?php
declare(strict_types=1);
namespace Shlinkio\Shlink\Common\IpGeolocation;
use Shlinkio\Shlink\Common\Exception\WrongIpException;
class EmptyIpLocationResolver implements IpLocationResolverInterface
{
/**
* @throws WrongIpException
*/
public function resolveIpLocation(string $ipAddress): array
{
return [
'country_code' => '',
'country_name' => '',
'region_name' => '',
'city' => '',
'latitude' => '',
'longitude' => '',
'time_zone' => '',
];
}
}