From 06fa33877bc53f898cbe23d050086d3f30273b65 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Wed, 20 Jul 2016 10:13:53 +0200 Subject: [PATCH] Moved some exceptions from core to common --- module/Common/config/services.config.php | 2 ++ module/Common/src/Exception/ExceptionInterface.php | 6 ++++++ .../src/Exception/InvalidArgumentException.php | 2 +- module/{Core => Common}/src/Exception/RuntimeException.php | 2 +- module/Core/src/Exception/ExceptionInterface.php | 6 ------ module/Core/src/Exception/InvalidShortCodeException.php | 2 ++ module/Core/src/Exception/InvalidUrlException.php | 2 ++ module/Core/src/Service/UrlShortener.php | 2 +- module/Core/src/Service/UrlShortenerInterface.php | 2 +- module/Core/src/Service/VisitsTracker.php | 2 +- module/Rest/src/Action/GetVisitsMiddleware.php | 2 +- module/Rest/src/Exception/AuthenticationException.php | 2 +- .../Rest/src/Middleware/CheckAuthenticationMiddleware.php | 2 +- module/Rest/src/Service/RestTokenService.php | 2 +- module/Rest/src/Service/RestTokenServiceInterface.php | 2 +- module/Rest/src/Util/RestUtils.php | 3 ++- 16 files changed, 24 insertions(+), 17 deletions(-) create mode 100644 module/Common/src/Exception/ExceptionInterface.php rename module/{Core => Common}/src/Exception/InvalidArgumentException.php (70%) rename module/{Core => Common}/src/Exception/RuntimeException.php (67%) delete mode 100644 module/Core/src/Exception/ExceptionInterface.php diff --git a/module/Common/config/services.config.php b/module/Common/config/services.config.php index b3c4e14d..838b7896 100644 --- a/module/Common/config/services.config.php +++ b/module/Common/config/services.config.php @@ -4,6 +4,7 @@ use Doctrine\Common\Cache\Cache; use Doctrine\ORM\EntityManager; use Shlinkio\Shlink\Common\Factory\CacheFactory; use Shlinkio\Shlink\Common\Factory\EntityManagerFactory; +use Shlinkio\Shlink\Common\Service\IpLocationResolver; use Zend\ServiceManager\Factory\InvokableFactory; return [ @@ -13,6 +14,7 @@ return [ EntityManager::class => EntityManagerFactory::class, GuzzleHttp\Client::class => InvokableFactory::class, Cache::class => CacheFactory::class, + IpLocationResolver::class => AnnotatedFactory::class, ], 'aliases' => [ 'em' => EntityManager::class, diff --git a/module/Common/src/Exception/ExceptionInterface.php b/module/Common/src/Exception/ExceptionInterface.php new file mode 100644 index 00000000..81255f6a --- /dev/null +++ b/module/Common/src/Exception/ExceptionInterface.php @@ -0,0 +1,6 @@ +