Moved some exceptions from core to common

This commit is contained in:
Alejandro Celaya
2016-07-20 10:13:53 +02:00
parent c290bed354
commit 06fa33877b
16 changed files with 24 additions and 17 deletions

View File

@@ -1,6 +0,0 @@
<?php
namespace Shlinkio\Shlink\Core\Exception;
interface ExceptionInterface
{
}

View File

@@ -1,6 +0,0 @@
<?php
namespace Shlinkio\Shlink\Core\Exception;
class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface
{
}

View File

@@ -1,6 +1,8 @@
<?php
namespace Shlinkio\Shlink\Core\Exception;
use Shlinkio\Shlink\Common\Exception\RuntimeException;
class InvalidShortCodeException extends RuntimeException
{
public static function fromShortCode($shortCode, $charSet, \Exception $previous = null)

View File

@@ -1,6 +1,8 @@
<?php
namespace Shlinkio\Shlink\Core\Exception;
use Shlinkio\Shlink\Common\Exception\RuntimeException;
class InvalidUrlException extends RuntimeException
{
public static function fromUrl($url, \Exception $previous = null)

View File

@@ -1,6 +0,0 @@
<?php
namespace Shlinkio\Shlink\Core\Exception;
class RuntimeException extends \RuntimeException implements ExceptionInterface
{
}

View File

@@ -7,10 +7,10 @@ use Doctrine\ORM\ORMException;
use GuzzleHttp\ClientInterface;
use GuzzleHttp\Exception\GuzzleException;
use Psr\Http\Message\UriInterface;
use Shlinkio\Shlink\Common\Exception\RuntimeException;
use Shlinkio\Shlink\Core\Entity\ShortUrl;
use Shlinkio\Shlink\Core\Exception\InvalidShortCodeException;
use Shlinkio\Shlink\Core\Exception\InvalidUrlException;
use Shlinkio\Shlink\Core\Exception\RuntimeException;
class UrlShortener implements UrlShortenerInterface
{

View File

@@ -2,9 +2,9 @@
namespace Shlinkio\Shlink\Core\Service;
use Psr\Http\Message\UriInterface;
use Shlinkio\Shlink\Common\Exception\RuntimeException;
use Shlinkio\Shlink\Core\Exception\InvalidShortCodeException;
use Shlinkio\Shlink\Core\Exception\InvalidUrlException;
use Shlinkio\Shlink\Core\Exception\RuntimeException;
interface UrlShortenerInterface
{

View File

@@ -3,9 +3,9 @@ namespace Shlinkio\Shlink\Core\Service;
use Acelaya\ZsmAnnotatedServices\Annotation\Inject;
use Doctrine\ORM\EntityManagerInterface;
use Shlinkio\Shlink\Common\Exception\InvalidArgumentException;
use Shlinkio\Shlink\Core\Entity\ShortUrl;
use Shlinkio\Shlink\Core\Entity\Visit;
use Shlinkio\Shlink\Core\Exception\InvalidArgumentException;
use Zend\Paginator\Paginator;
class VisitsTracker implements VisitsTrackerInterface