Created new namespace for IP geolocation elements

This commit is contained in:
Alejandro Celaya 2018-11-11 12:44:57 +01:00
parent bbe85cde31
commit b530cf4461
8 changed files with 13 additions and 13 deletions

View File

@ -3,7 +3,7 @@ declare(strict_types=1);
namespace Shlinkio\Shlink\CLI;
use Shlinkio\Shlink\Common\Service\IpLocationResolverInterface;
use Shlinkio\Shlink\Common\IpGeolocation\IpLocationResolverInterface;
use Shlinkio\Shlink\Common\Service\PreviewGenerator;
use Shlinkio\Shlink\Core\Service;
use Shlinkio\Shlink\Rest\Service\ApiKeyService;

View File

@ -4,7 +4,7 @@ declare(strict_types=1);
namespace Shlinkio\Shlink\CLI\Command\Visit;
use Shlinkio\Shlink\Common\Exception\WrongIpException;
use Shlinkio\Shlink\Common\Service\IpLocationResolverInterface;
use Shlinkio\Shlink\Common\IpGeolocation\IpLocationResolverInterface;
use Shlinkio\Shlink\Common\Util\IpAddress;
use Shlinkio\Shlink\Core\Entity\VisitLocation;
use Shlinkio\Shlink\Core\Service\VisitServiceInterface;

View File

@ -7,7 +7,7 @@ use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\Prophecy\ObjectProphecy;
use Shlinkio\Shlink\CLI\Command\Visit\ProcessVisitsCommand;
use Shlinkio\Shlink\Common\Service\IpApiLocationResolver;
use Shlinkio\Shlink\Common\IpGeolocation\IpApiLocationResolver;
use Shlinkio\Shlink\Core\Entity\ShortUrl;
use Shlinkio\Shlink\Core\Entity\Visit;
use Shlinkio\Shlink\Core\Model\Visitor;

View File

@ -34,8 +34,8 @@ return [
Image\ImageBuilder::class => Image\ImageBuilderFactory::class,
Service\IpApiLocationResolver::class => ConfigAbstractFactory::class,
Service\GeoLite2LocationResolver::class => ConfigAbstractFactory::class,
IpGeolocation\IpApiLocationResolver::class => ConfigAbstractFactory::class,
IpGeolocation\GeoLite2LocationResolver::class => ConfigAbstractFactory::class,
Service\PreviewGenerator::class => ConfigAbstractFactory::class,
],
'aliases' => [
@ -45,7 +45,7 @@ return [
'logger' => LoggerInterface::class,
Logger::class => 'Logger_Shlink',
LoggerInterface::class => 'Logger_Shlink',
Service\IpLocationResolverInterface::class => Service\GeoLite2LocationResolver::class,
IpGeolocation\IpLocationResolverInterface::class => IpGeolocation\GeoLite2LocationResolver::class,
],
'abstract_factories' => [
Factory\DottedAccessConfigAbstractFactory::class,
@ -57,8 +57,8 @@ return [
Template\Extension\TranslatorExtension::class => ['translator'],
Middleware\LocaleMiddleware::class => ['translator'],
Service\IpApiLocationResolver::class => ['httpClient'],
Service\GeoLite2LocationResolver::class => [Reader::class],
IpGeolocation\IpApiLocationResolver::class => ['httpClient'],
IpGeolocation\GeoLite2LocationResolver::class => [Reader::class],
Service\PreviewGenerator::class => [
Image\ImageBuilder::class,
Filesystem::class,

View File

@ -1,7 +1,7 @@
<?php
declare(strict_types=1);
namespace Shlinkio\Shlink\Common\Service;
namespace Shlinkio\Shlink\Common\IpGeolocation;
use GeoIp2\Database\Reader;
use GeoIp2\Exception\AddressNotFoundException;

View File

@ -1,7 +1,7 @@
<?php
declare(strict_types=1);
namespace Shlinkio\Shlink\Common\Service;
namespace Shlinkio\Shlink\Common\IpGeolocation;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\GuzzleException;

View File

@ -1,7 +1,7 @@
<?php
declare(strict_types=1);
namespace Shlinkio\Shlink\Common\Service;
namespace Shlinkio\Shlink\Common\IpGeolocation;
use Shlinkio\Shlink\Common\Exception\WrongIpException;

View File

@ -1,14 +1,14 @@
<?php
declare(strict_types=1);
namespace ShlinkioTest\Shlink\Common\Service;
namespace ShlinkioTest\Shlink\Common\IpGeolocation;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\TransferException;
use GuzzleHttp\Psr7\Response;
use PHPUnit\Framework\TestCase;
use Prophecy\Prophecy\ObjectProphecy;
use Shlinkio\Shlink\Common\Service\IpApiLocationResolver;
use Shlinkio\Shlink\Common\IpGeolocation\IpApiLocationResolver;
use function json_encode;
class IpApiLocationResolverTest extends TestCase