mirror of
https://github.com/shlinkio/shlink.git
synced 2024-11-23 13:23:33 +03:00
Removed logger dependency from rest actions
This commit is contained in:
parent
d067f52ac2
commit
aece9e68ba
17 changed files with 33 additions and 94 deletions
|
@ -7,7 +7,6 @@ namespace Shlinkio\Shlink\Rest;
|
||||||
use Laminas\ServiceManager\AbstractFactory\ConfigAbstractFactory;
|
use Laminas\ServiceManager\AbstractFactory\ConfigAbstractFactory;
|
||||||
use Laminas\ServiceManager\Factory\InvokableFactory;
|
use Laminas\ServiceManager\Factory\InvokableFactory;
|
||||||
use Mezzio\Router\Middleware\ImplicitOptionsMiddleware;
|
use Mezzio\Router\Middleware\ImplicitOptionsMiddleware;
|
||||||
use Psr\Log\LoggerInterface;
|
|
||||||
use Shlinkio\Shlink\Common\Mercure\LcobucciJwtProvider;
|
use Shlinkio\Shlink\Common\Mercure\LcobucciJwtProvider;
|
||||||
use Shlinkio\Shlink\Core\Options\AppOptions;
|
use Shlinkio\Shlink\Core\Options\AppOptions;
|
||||||
use Shlinkio\Shlink\Core\Service;
|
use Shlinkio\Shlink\Core\Service;
|
||||||
|
@ -48,37 +47,28 @@ return [
|
||||||
ConfigAbstractFactory::class => [
|
ConfigAbstractFactory::class => [
|
||||||
ApiKeyService::class => ['em'],
|
ApiKeyService::class => ['em'],
|
||||||
|
|
||||||
Action\HealthAction::class => ['em', AppOptions::class, 'Logger_Shlink'],
|
Action\HealthAction::class => ['em', AppOptions::class],
|
||||||
Action\MercureInfoAction::class => [LcobucciJwtProvider::class, 'config.mercure', 'Logger_Shlink'],
|
Action\MercureInfoAction::class => [LcobucciJwtProvider::class, 'config.mercure'],
|
||||||
Action\ShortUrl\CreateShortUrlAction::class => [
|
Action\ShortUrl\CreateShortUrlAction::class => [Service\UrlShortener::class, 'config.url_shortener.domain'],
|
||||||
Service\UrlShortener::class,
|
|
||||||
'config.url_shortener.domain',
|
|
||||||
'Logger_Shlink',
|
|
||||||
],
|
|
||||||
Action\ShortUrl\SingleStepCreateShortUrlAction::class => [
|
Action\ShortUrl\SingleStepCreateShortUrlAction::class => [
|
||||||
Service\UrlShortener::class,
|
Service\UrlShortener::class,
|
||||||
ApiKeyService::class,
|
ApiKeyService::class,
|
||||||
'config.url_shortener.domain',
|
'config.url_shortener.domain',
|
||||||
'Logger_Shlink',
|
|
||||||
],
|
],
|
||||||
Action\ShortUrl\EditShortUrlAction::class => [Service\ShortUrlService::class, 'Logger_Shlink'],
|
Action\ShortUrl\EditShortUrlAction::class => [Service\ShortUrlService::class],
|
||||||
Action\ShortUrl\DeleteShortUrlAction::class => [Service\ShortUrl\DeleteShortUrlService::class, 'Logger_Shlink'],
|
Action\ShortUrl\DeleteShortUrlAction::class => [Service\ShortUrl\DeleteShortUrlService::class],
|
||||||
Action\ShortUrl\ResolveShortUrlAction::class => [
|
Action\ShortUrl\ResolveShortUrlAction::class => [
|
||||||
Service\ShortUrl\ShortUrlResolver::class,
|
Service\ShortUrl\ShortUrlResolver::class,
|
||||||
'config.url_shortener.domain',
|
'config.url_shortener.domain',
|
||||||
],
|
],
|
||||||
Action\Visit\ShortUrlVisitsAction::class => [Service\VisitsTracker::class, 'Logger_Shlink'],
|
Action\Visit\ShortUrlVisitsAction::class => [Service\VisitsTracker::class],
|
||||||
Action\Visit\GlobalVisitsAction::class => [Visit\VisitsStatsHelper::class, 'Logger_Shlink'],
|
Action\Visit\GlobalVisitsAction::class => [Visit\VisitsStatsHelper::class],
|
||||||
Action\ShortUrl\ListShortUrlsAction::class => [
|
Action\ShortUrl\ListShortUrlsAction::class => [Service\ShortUrlService::class, 'config.url_shortener.domain'],
|
||||||
Service\ShortUrlService::class,
|
Action\ShortUrl\EditShortUrlTagsAction::class => [Service\ShortUrlService::class],
|
||||||
'config.url_shortener.domain',
|
Action\Tag\ListTagsAction::class => [Service\Tag\TagService::class],
|
||||||
'Logger_Shlink',
|
Action\Tag\DeleteTagsAction::class => [Service\Tag\TagService::class],
|
||||||
],
|
Action\Tag\CreateTagsAction::class => [Service\Tag\TagService::class],
|
||||||
Action\ShortUrl\EditShortUrlTagsAction::class => [Service\ShortUrlService::class, 'Logger_Shlink'],
|
Action\Tag\UpdateTagAction::class => [Service\Tag\TagService::class],
|
||||||
Action\Tag\ListTagsAction::class => [Service\Tag\TagService::class, LoggerInterface::class],
|
|
||||||
Action\Tag\DeleteTagsAction::class => [Service\Tag\TagService::class, LoggerInterface::class],
|
|
||||||
Action\Tag\CreateTagsAction::class => [Service\Tag\TagService::class, LoggerInterface::class],
|
|
||||||
Action\Tag\UpdateTagAction::class => [Service\Tag\TagService::class, LoggerInterface::class],
|
|
||||||
|
|
||||||
Middleware\ShortUrl\DropDefaultDomainFromRequestMiddleware::class => ['config.url_shortener.domain.hostname'],
|
Middleware\ShortUrl\DropDefaultDomainFromRequestMiddleware::class => ['config.url_shortener.domain.hostname'],
|
||||||
Middleware\ShortUrl\DefaultShortCodesLengthMiddleware::class => [
|
Middleware\ShortUrl\DefaultShortCodesLengthMiddleware::class => [
|
||||||
|
|
|
@ -7,8 +7,6 @@ namespace Shlinkio\Shlink\Rest\Action;
|
||||||
use Fig\Http\Message\RequestMethodInterface;
|
use Fig\Http\Message\RequestMethodInterface;
|
||||||
use Fig\Http\Message\StatusCodeInterface;
|
use Fig\Http\Message\StatusCodeInterface;
|
||||||
use Psr\Http\Server\RequestHandlerInterface;
|
use Psr\Http\Server\RequestHandlerInterface;
|
||||||
use Psr\Log\LoggerInterface;
|
|
||||||
use Psr\Log\NullLogger;
|
|
||||||
|
|
||||||
use function array_merge;
|
use function array_merge;
|
||||||
|
|
||||||
|
@ -17,13 +15,6 @@ abstract class AbstractRestAction implements RequestHandlerInterface, RequestMet
|
||||||
protected const ROUTE_PATH = '';
|
protected const ROUTE_PATH = '';
|
||||||
protected const ROUTE_ALLOWED_METHODS = [];
|
protected const ROUTE_ALLOWED_METHODS = [];
|
||||||
|
|
||||||
protected LoggerInterface $logger;
|
|
||||||
|
|
||||||
public function __construct(?LoggerInterface $logger = null)
|
|
||||||
{
|
|
||||||
$this->logger = $logger ?? new NullLogger();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function getRouteDef(array $prevMiddleware = [], array $postMiddleware = []): array
|
public static function getRouteDef(array $prevMiddleware = [], array $postMiddleware = []): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
|
|
@ -8,7 +8,6 @@ use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Laminas\Diactoros\Response\JsonResponse;
|
use Laminas\Diactoros\Response\JsonResponse;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
use Psr\Log\LoggerInterface;
|
|
||||||
use Shlinkio\Shlink\Core\Options\AppOptions;
|
use Shlinkio\Shlink\Core\Options\AppOptions;
|
||||||
use Throwable;
|
use Throwable;
|
||||||
|
|
||||||
|
@ -24,9 +23,8 @@ class HealthAction extends AbstractRestAction
|
||||||
private EntityManagerInterface $em;
|
private EntityManagerInterface $em;
|
||||||
private AppOptions $options;
|
private AppOptions $options;
|
||||||
|
|
||||||
public function __construct(EntityManagerInterface $em, AppOptions $options, ?LoggerInterface $logger = null)
|
public function __construct(EntityManagerInterface $em, AppOptions $options)
|
||||||
{
|
{
|
||||||
parent::__construct($logger);
|
|
||||||
$this->em = $em;
|
$this->em = $em;
|
||||||
$this->options = $options;
|
$this->options = $options;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,6 @@ use Cake\Chronos\Chronos;
|
||||||
use Laminas\Diactoros\Response\JsonResponse;
|
use Laminas\Diactoros\Response\JsonResponse;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
use Psr\Log\LoggerInterface;
|
|
||||||
use Shlinkio\Shlink\Common\Mercure\JwtProviderInterface;
|
use Shlinkio\Shlink\Common\Mercure\JwtProviderInterface;
|
||||||
use Shlinkio\Shlink\Rest\Exception\MercureException;
|
use Shlinkio\Shlink\Rest\Exception\MercureException;
|
||||||
use Throwable;
|
use Throwable;
|
||||||
|
@ -23,12 +22,8 @@ class MercureInfoAction extends AbstractRestAction
|
||||||
private JwtProviderInterface $jwtProvider;
|
private JwtProviderInterface $jwtProvider;
|
||||||
private array $mercureConfig;
|
private array $mercureConfig;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(JwtProviderInterface $jwtProvider, array $mercureConfig)
|
||||||
JwtProviderInterface $jwtProvider,
|
{
|
||||||
array $mercureConfig,
|
|
||||||
?LoggerInterface $logger = null
|
|
||||||
) {
|
|
||||||
parent::__construct($logger);
|
|
||||||
$this->jwtProvider = $jwtProvider;
|
$this->jwtProvider = $jwtProvider;
|
||||||
$this->mercureConfig = $mercureConfig;
|
$this->mercureConfig = $mercureConfig;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,6 @@ namespace Shlinkio\Shlink\Rest\Action\ShortUrl;
|
||||||
use Laminas\Diactoros\Response\JsonResponse;
|
use Laminas\Diactoros\Response\JsonResponse;
|
||||||
use Psr\Http\Message\ResponseInterface as Response;
|
use Psr\Http\Message\ResponseInterface as Response;
|
||||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||||
use Psr\Log\LoggerInterface;
|
|
||||||
use Shlinkio\Shlink\Core\Exception\ValidationException;
|
use Shlinkio\Shlink\Core\Exception\ValidationException;
|
||||||
use Shlinkio\Shlink\Core\Model\CreateShortUrlData;
|
use Shlinkio\Shlink\Core\Model\CreateShortUrlData;
|
||||||
use Shlinkio\Shlink\Core\Service\UrlShortenerInterface;
|
use Shlinkio\Shlink\Core\Service\UrlShortenerInterface;
|
||||||
|
@ -19,12 +18,8 @@ abstract class AbstractCreateShortUrlAction extends AbstractRestAction
|
||||||
private UrlShortenerInterface $urlShortener;
|
private UrlShortenerInterface $urlShortener;
|
||||||
private array $domainConfig;
|
private array $domainConfig;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(UrlShortenerInterface $urlShortener, array $domainConfig)
|
||||||
UrlShortenerInterface $urlShortener,
|
{
|
||||||
array $domainConfig,
|
|
||||||
?LoggerInterface $logger = null
|
|
||||||
) {
|
|
||||||
parent::__construct($logger);
|
|
||||||
$this->urlShortener = $urlShortener;
|
$this->urlShortener = $urlShortener;
|
||||||
$this->domainConfig = $domainConfig;
|
$this->domainConfig = $domainConfig;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,6 @@ namespace Shlinkio\Shlink\Rest\Action\ShortUrl;
|
||||||
use Laminas\Diactoros\Response\EmptyResponse;
|
use Laminas\Diactoros\Response\EmptyResponse;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
use Psr\Log\LoggerInterface;
|
|
||||||
use Shlinkio\Shlink\Core\Model\ShortUrlIdentifier;
|
use Shlinkio\Shlink\Core\Model\ShortUrlIdentifier;
|
||||||
use Shlinkio\Shlink\Core\Service\ShortUrl\DeleteShortUrlServiceInterface;
|
use Shlinkio\Shlink\Core\Service\ShortUrl\DeleteShortUrlServiceInterface;
|
||||||
use Shlinkio\Shlink\Rest\Action\AbstractRestAction;
|
use Shlinkio\Shlink\Rest\Action\AbstractRestAction;
|
||||||
|
@ -19,9 +18,8 @@ class DeleteShortUrlAction extends AbstractRestAction
|
||||||
|
|
||||||
private DeleteShortUrlServiceInterface $deleteShortUrlService;
|
private DeleteShortUrlServiceInterface $deleteShortUrlService;
|
||||||
|
|
||||||
public function __construct(DeleteShortUrlServiceInterface $deleteShortUrlService, ?LoggerInterface $logger = null)
|
public function __construct(DeleteShortUrlServiceInterface $deleteShortUrlService)
|
||||||
{
|
{
|
||||||
parent::__construct($logger);
|
|
||||||
$this->deleteShortUrlService = $deleteShortUrlService;
|
$this->deleteShortUrlService = $deleteShortUrlService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@ namespace Shlinkio\Shlink\Rest\Action\ShortUrl;
|
||||||
use Laminas\Diactoros\Response\EmptyResponse;
|
use Laminas\Diactoros\Response\EmptyResponse;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
use Psr\Log\LoggerInterface;
|
|
||||||
use Shlinkio\Shlink\Core\Model\ShortUrlEdit;
|
use Shlinkio\Shlink\Core\Model\ShortUrlEdit;
|
||||||
use Shlinkio\Shlink\Core\Model\ShortUrlIdentifier;
|
use Shlinkio\Shlink\Core\Model\ShortUrlIdentifier;
|
||||||
use Shlinkio\Shlink\Core\Service\ShortUrlServiceInterface;
|
use Shlinkio\Shlink\Core\Service\ShortUrlServiceInterface;
|
||||||
|
@ -20,9 +19,8 @@ class EditShortUrlAction extends AbstractRestAction
|
||||||
|
|
||||||
private ShortUrlServiceInterface $shortUrlService;
|
private ShortUrlServiceInterface $shortUrlService;
|
||||||
|
|
||||||
public function __construct(ShortUrlServiceInterface $shortUrlService, ?LoggerInterface $logger = null)
|
public function __construct(ShortUrlServiceInterface $shortUrlService)
|
||||||
{
|
{
|
||||||
parent::__construct($logger);
|
|
||||||
$this->shortUrlService = $shortUrlService;
|
$this->shortUrlService = $shortUrlService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@ namespace Shlinkio\Shlink\Rest\Action\ShortUrl;
|
||||||
use Laminas\Diactoros\Response\JsonResponse;
|
use Laminas\Diactoros\Response\JsonResponse;
|
||||||
use Psr\Http\Message\ResponseInterface as Response;
|
use Psr\Http\Message\ResponseInterface as Response;
|
||||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||||
use Psr\Log\LoggerInterface;
|
|
||||||
use Shlinkio\Shlink\Core\Exception\ValidationException;
|
use Shlinkio\Shlink\Core\Exception\ValidationException;
|
||||||
use Shlinkio\Shlink\Core\Model\ShortUrlIdentifier;
|
use Shlinkio\Shlink\Core\Model\ShortUrlIdentifier;
|
||||||
use Shlinkio\Shlink\Core\Service\ShortUrlServiceInterface;
|
use Shlinkio\Shlink\Core\Service\ShortUrlServiceInterface;
|
||||||
|
@ -20,9 +19,8 @@ class EditShortUrlTagsAction extends AbstractRestAction
|
||||||
|
|
||||||
private ShortUrlServiceInterface $shortUrlService;
|
private ShortUrlServiceInterface $shortUrlService;
|
||||||
|
|
||||||
public function __construct(ShortUrlServiceInterface $shortUrlService, ?LoggerInterface $logger = null)
|
public function __construct(ShortUrlServiceInterface $shortUrlService)
|
||||||
{
|
{
|
||||||
parent::__construct($logger);
|
|
||||||
$this->shortUrlService = $shortUrlService;
|
$this->shortUrlService = $shortUrlService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@ namespace Shlinkio\Shlink\Rest\Action\ShortUrl;
|
||||||
use Laminas\Diactoros\Response\JsonResponse;
|
use Laminas\Diactoros\Response\JsonResponse;
|
||||||
use Psr\Http\Message\ResponseInterface as Response;
|
use Psr\Http\Message\ResponseInterface as Response;
|
||||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||||
use Psr\Log\LoggerInterface;
|
|
||||||
use Shlinkio\Shlink\Common\Paginator\Util\PaginatorUtilsTrait;
|
use Shlinkio\Shlink\Common\Paginator\Util\PaginatorUtilsTrait;
|
||||||
use Shlinkio\Shlink\Core\Model\ShortUrlsParams;
|
use Shlinkio\Shlink\Core\Model\ShortUrlsParams;
|
||||||
use Shlinkio\Shlink\Core\Service\ShortUrlServiceInterface;
|
use Shlinkio\Shlink\Core\Service\ShortUrlServiceInterface;
|
||||||
|
@ -24,12 +23,8 @@ class ListShortUrlsAction extends AbstractRestAction
|
||||||
private ShortUrlServiceInterface $shortUrlService;
|
private ShortUrlServiceInterface $shortUrlService;
|
||||||
private array $domainConfig;
|
private array $domainConfig;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(ShortUrlServiceInterface $shortUrlService, array $domainConfig)
|
||||||
ShortUrlServiceInterface $shortUrlService,
|
{
|
||||||
array $domainConfig,
|
|
||||||
?LoggerInterface $logger = null
|
|
||||||
) {
|
|
||||||
parent::__construct($logger);
|
|
||||||
$this->shortUrlService = $shortUrlService;
|
$this->shortUrlService = $shortUrlService;
|
||||||
$this->domainConfig = $domainConfig;
|
$this->domainConfig = $domainConfig;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,6 @@ namespace Shlinkio\Shlink\Rest\Action\ShortUrl;
|
||||||
use Laminas\Diactoros\Response\JsonResponse;
|
use Laminas\Diactoros\Response\JsonResponse;
|
||||||
use Psr\Http\Message\ResponseInterface as Response;
|
use Psr\Http\Message\ResponseInterface as Response;
|
||||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||||
use Psr\Log\LoggerInterface;
|
|
||||||
use Shlinkio\Shlink\Core\Model\ShortUrlIdentifier;
|
use Shlinkio\Shlink\Core\Model\ShortUrlIdentifier;
|
||||||
use Shlinkio\Shlink\Core\Service\ShortUrl\ShortUrlResolverInterface;
|
use Shlinkio\Shlink\Core\Service\ShortUrl\ShortUrlResolverInterface;
|
||||||
use Shlinkio\Shlink\Core\Transformer\ShortUrlDataTransformer;
|
use Shlinkio\Shlink\Core\Transformer\ShortUrlDataTransformer;
|
||||||
|
@ -21,12 +20,8 @@ class ResolveShortUrlAction extends AbstractRestAction
|
||||||
private ShortUrlResolverInterface $urlResolver;
|
private ShortUrlResolverInterface $urlResolver;
|
||||||
private array $domainConfig;
|
private array $domainConfig;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(ShortUrlResolverInterface $urlResolver, array $domainConfig)
|
||||||
ShortUrlResolverInterface $urlResolver,
|
{
|
||||||
array $domainConfig,
|
|
||||||
?LoggerInterface $logger = null
|
|
||||||
) {
|
|
||||||
parent::__construct($logger);
|
|
||||||
$this->urlResolver = $urlResolver;
|
$this->urlResolver = $urlResolver;
|
||||||
$this->domainConfig = $domainConfig;
|
$this->domainConfig = $domainConfig;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,6 @@ namespace Shlinkio\Shlink\Rest\Action\ShortUrl;
|
||||||
|
|
||||||
use Laminas\Diactoros\Uri;
|
use Laminas\Diactoros\Uri;
|
||||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||||
use Psr\Log\LoggerInterface;
|
|
||||||
use Shlinkio\Shlink\Core\Exception\ValidationException;
|
use Shlinkio\Shlink\Core\Exception\ValidationException;
|
||||||
use Shlinkio\Shlink\Core\Model\CreateShortUrlData;
|
use Shlinkio\Shlink\Core\Model\CreateShortUrlData;
|
||||||
use Shlinkio\Shlink\Core\Service\UrlShortenerInterface;
|
use Shlinkio\Shlink\Core\Service\UrlShortenerInterface;
|
||||||
|
@ -22,10 +21,9 @@ class SingleStepCreateShortUrlAction extends AbstractCreateShortUrlAction
|
||||||
public function __construct(
|
public function __construct(
|
||||||
UrlShortenerInterface $urlShortener,
|
UrlShortenerInterface $urlShortener,
|
||||||
ApiKeyServiceInterface $apiKeyService,
|
ApiKeyServiceInterface $apiKeyService,
|
||||||
array $domainConfig,
|
array $domainConfig
|
||||||
?LoggerInterface $logger = null
|
|
||||||
) {
|
) {
|
||||||
parent::__construct($urlShortener, $domainConfig, $logger);
|
parent::__construct($urlShortener, $domainConfig);
|
||||||
$this->apiKeyService = $apiKeyService;
|
$this->apiKeyService = $apiKeyService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@ namespace Shlinkio\Shlink\Rest\Action\Tag;
|
||||||
use Laminas\Diactoros\Response\JsonResponse;
|
use Laminas\Diactoros\Response\JsonResponse;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
use Psr\Log\LoggerInterface;
|
|
||||||
use Shlinkio\Shlink\Core\Service\Tag\TagServiceInterface;
|
use Shlinkio\Shlink\Core\Service\Tag\TagServiceInterface;
|
||||||
use Shlinkio\Shlink\Rest\Action\AbstractRestAction;
|
use Shlinkio\Shlink\Rest\Action\AbstractRestAction;
|
||||||
|
|
||||||
|
@ -18,9 +17,8 @@ class CreateTagsAction extends AbstractRestAction
|
||||||
|
|
||||||
private TagServiceInterface $tagService;
|
private TagServiceInterface $tagService;
|
||||||
|
|
||||||
public function __construct(TagServiceInterface $tagService, ?LoggerInterface $logger = null)
|
public function __construct(TagServiceInterface $tagService)
|
||||||
{
|
{
|
||||||
parent::__construct($logger);
|
|
||||||
$this->tagService = $tagService;
|
$this->tagService = $tagService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@ namespace Shlinkio\Shlink\Rest\Action\Tag;
|
||||||
use Laminas\Diactoros\Response\EmptyResponse;
|
use Laminas\Diactoros\Response\EmptyResponse;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
use Psr\Log\LoggerInterface;
|
|
||||||
use Shlinkio\Shlink\Core\Service\Tag\TagServiceInterface;
|
use Shlinkio\Shlink\Core\Service\Tag\TagServiceInterface;
|
||||||
use Shlinkio\Shlink\Rest\Action\AbstractRestAction;
|
use Shlinkio\Shlink\Rest\Action\AbstractRestAction;
|
||||||
|
|
||||||
|
@ -18,9 +17,8 @@ class DeleteTagsAction extends AbstractRestAction
|
||||||
|
|
||||||
private TagServiceInterface $tagService;
|
private TagServiceInterface $tagService;
|
||||||
|
|
||||||
public function __construct(TagServiceInterface $tagService, ?LoggerInterface $logger = null)
|
public function __construct(TagServiceInterface $tagService)
|
||||||
{
|
{
|
||||||
parent::__construct($logger);
|
|
||||||
$this->tagService = $tagService;
|
$this->tagService = $tagService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@ namespace Shlinkio\Shlink\Rest\Action\Tag;
|
||||||
use Laminas\Diactoros\Response\JsonResponse;
|
use Laminas\Diactoros\Response\JsonResponse;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
use Psr\Log\LoggerInterface;
|
|
||||||
use Shlinkio\Shlink\Core\Service\Tag\TagServiceInterface;
|
use Shlinkio\Shlink\Core\Service\Tag\TagServiceInterface;
|
||||||
use Shlinkio\Shlink\Rest\Action\AbstractRestAction;
|
use Shlinkio\Shlink\Rest\Action\AbstractRestAction;
|
||||||
|
|
||||||
|
@ -18,9 +17,8 @@ class ListTagsAction extends AbstractRestAction
|
||||||
|
|
||||||
private TagServiceInterface $tagService;
|
private TagServiceInterface $tagService;
|
||||||
|
|
||||||
public function __construct(TagServiceInterface $tagService, ?LoggerInterface $logger = null)
|
public function __construct(TagServiceInterface $tagService)
|
||||||
{
|
{
|
||||||
parent::__construct($logger);
|
|
||||||
$this->tagService = $tagService;
|
$this->tagService = $tagService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@ namespace Shlinkio\Shlink\Rest\Action\Tag;
|
||||||
use Laminas\Diactoros\Response\EmptyResponse;
|
use Laminas\Diactoros\Response\EmptyResponse;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
use Psr\Log\LoggerInterface;
|
|
||||||
use Shlinkio\Shlink\Core\Exception\ValidationException;
|
use Shlinkio\Shlink\Core\Exception\ValidationException;
|
||||||
use Shlinkio\Shlink\Core\Service\Tag\TagServiceInterface;
|
use Shlinkio\Shlink\Core\Service\Tag\TagServiceInterface;
|
||||||
use Shlinkio\Shlink\Rest\Action\AbstractRestAction;
|
use Shlinkio\Shlink\Rest\Action\AbstractRestAction;
|
||||||
|
@ -19,9 +18,8 @@ class UpdateTagAction extends AbstractRestAction
|
||||||
|
|
||||||
private TagServiceInterface $tagService;
|
private TagServiceInterface $tagService;
|
||||||
|
|
||||||
public function __construct(TagServiceInterface $tagService, ?LoggerInterface $logger = null)
|
public function __construct(TagServiceInterface $tagService)
|
||||||
{
|
{
|
||||||
parent::__construct($logger);
|
|
||||||
$this->tagService = $tagService;
|
$this->tagService = $tagService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@ namespace Shlinkio\Shlink\Rest\Action\Visit;
|
||||||
use Laminas\Diactoros\Response\JsonResponse;
|
use Laminas\Diactoros\Response\JsonResponse;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
use Psr\Log\LoggerInterface;
|
|
||||||
use Shlinkio\Shlink\Core\Visit\VisitsStatsHelperInterface;
|
use Shlinkio\Shlink\Core\Visit\VisitsStatsHelperInterface;
|
||||||
use Shlinkio\Shlink\Rest\Action\AbstractRestAction;
|
use Shlinkio\Shlink\Rest\Action\AbstractRestAction;
|
||||||
|
|
||||||
|
@ -18,9 +17,8 @@ class GlobalVisitsAction extends AbstractRestAction
|
||||||
|
|
||||||
private VisitsStatsHelperInterface $statsHelper;
|
private VisitsStatsHelperInterface $statsHelper;
|
||||||
|
|
||||||
public function __construct(VisitsStatsHelperInterface $statsHelper, ?LoggerInterface $logger = null)
|
public function __construct(VisitsStatsHelperInterface $statsHelper)
|
||||||
{
|
{
|
||||||
parent::__construct($logger);
|
|
||||||
$this->statsHelper = $statsHelper;
|
$this->statsHelper = $statsHelper;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@ namespace Shlinkio\Shlink\Rest\Action\Visit;
|
||||||
use Laminas\Diactoros\Response\JsonResponse;
|
use Laminas\Diactoros\Response\JsonResponse;
|
||||||
use Psr\Http\Message\ResponseInterface as Response;
|
use Psr\Http\Message\ResponseInterface as Response;
|
||||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||||
use Psr\Log\LoggerInterface;
|
|
||||||
use Shlinkio\Shlink\Common\Paginator\Util\PaginatorUtilsTrait;
|
use Shlinkio\Shlink\Common\Paginator\Util\PaginatorUtilsTrait;
|
||||||
use Shlinkio\Shlink\Core\Model\ShortUrlIdentifier;
|
use Shlinkio\Shlink\Core\Model\ShortUrlIdentifier;
|
||||||
use Shlinkio\Shlink\Core\Model\VisitsParams;
|
use Shlinkio\Shlink\Core\Model\VisitsParams;
|
||||||
|
@ -23,9 +22,8 @@ class ShortUrlVisitsAction extends AbstractRestAction
|
||||||
|
|
||||||
private VisitsTrackerInterface $visitsTracker;
|
private VisitsTrackerInterface $visitsTracker;
|
||||||
|
|
||||||
public function __construct(VisitsTrackerInterface $visitsTracker, ?LoggerInterface $logger = null)
|
public function __construct(VisitsTrackerInterface $visitsTracker)
|
||||||
{
|
{
|
||||||
parent::__construct($logger);
|
|
||||||
$this->visitsTracker = $visitsTracker;
|
$this->visitsTracker = $visitsTracker;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue