From b530cf446185bbdb68dc79bd1070a9c81a1555b2 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 11 Nov 2018 12:44:57 +0100 Subject: [PATCH] Created new namespace for IP geolocation elements --- module/CLI/config/dependencies.config.php | 2 +- module/CLI/src/Command/Visit/ProcessVisitsCommand.php | 2 +- .../test/Command/Visit/ProcessVisitsCommandTest.php | 2 +- module/Common/config/dependencies.config.php | 10 +++++----- .../GeoLite2LocationResolver.php | 2 +- .../IpApiLocationResolver.php | 2 +- .../IpLocationResolverInterface.php | 2 +- .../IpApiLocationResolverTest.php | 4 ++-- 8 files changed, 13 insertions(+), 13 deletions(-) rename module/Common/src/{Service => IpGeolocation}/GeoLite2LocationResolver.php (97%) rename module/Common/src/{Service => IpGeolocation}/IpApiLocationResolver.php (97%) rename module/Common/src/{Service => IpGeolocation}/IpLocationResolverInterface.php (93%) rename module/Common/test/{Service => IpGeolocation}/IpApiLocationResolverTest.php (95%) diff --git a/module/CLI/config/dependencies.config.php b/module/CLI/config/dependencies.config.php index 2976e5b0..b226933c 100644 --- a/module/CLI/config/dependencies.config.php +++ b/module/CLI/config/dependencies.config.php @@ -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; diff --git a/module/CLI/src/Command/Visit/ProcessVisitsCommand.php b/module/CLI/src/Command/Visit/ProcessVisitsCommand.php index 3d36695c..799b51e9 100644 --- a/module/CLI/src/Command/Visit/ProcessVisitsCommand.php +++ b/module/CLI/src/Command/Visit/ProcessVisitsCommand.php @@ -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; diff --git a/module/CLI/test/Command/Visit/ProcessVisitsCommandTest.php b/module/CLI/test/Command/Visit/ProcessVisitsCommandTest.php index 361e23d0..e2a36ba6 100644 --- a/module/CLI/test/Command/Visit/ProcessVisitsCommandTest.php +++ b/module/CLI/test/Command/Visit/ProcessVisitsCommandTest.php @@ -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; diff --git a/module/Common/config/dependencies.config.php b/module/Common/config/dependencies.config.php index d8df79aa..4b63f602 100644 --- a/module/Common/config/dependencies.config.php +++ b/module/Common/config/dependencies.config.php @@ -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, diff --git a/module/Common/src/Service/GeoLite2LocationResolver.php b/module/Common/src/IpGeolocation/GeoLite2LocationResolver.php similarity index 97% rename from module/Common/src/Service/GeoLite2LocationResolver.php rename to module/Common/src/IpGeolocation/GeoLite2LocationResolver.php index 104a1ab3..68becdb6 100644 --- a/module/Common/src/Service/GeoLite2LocationResolver.php +++ b/module/Common/src/IpGeolocation/GeoLite2LocationResolver.php @@ -1,7 +1,7 @@