Replaced more ussages of AnnotatedFactory by ConfigAbstractFactory

This commit is contained in:
Alejandro Celaya
2017-07-22 13:48:30 +02:00
parent 9ef9da0870
commit b93d65ddc1
10 changed files with 34 additions and 91 deletions

View File

@@ -1,16 +1,13 @@
<?php
namespace Shlinkio\Shlink\Core\Action;
use Acelaya\ZsmAnnotatedServices\Annotation\Inject;
use Interop\Http\ServerMiddleware\DelegateInterface;
use Interop\Http\ServerMiddleware\MiddlewareInterface;
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use Shlinkio\Shlink\Common\Service\PreviewGenerator;
use Shlinkio\Shlink\Common\Service\PreviewGeneratorInterface;
use Shlinkio\Shlink\Common\Util\ResponseUtilsTrait;
use Shlinkio\Shlink\Core\Exception\InvalidShortCodeException;
use Shlinkio\Shlink\Core\Service\UrlShortener;
use Shlinkio\Shlink\Core\Service\UrlShortenerInterface;
class PreviewAction implements MiddlewareInterface
@@ -26,13 +23,6 @@ class PreviewAction implements MiddlewareInterface
*/
private $urlShortener;
/**
* PreviewAction constructor.
* @param PreviewGeneratorInterface $previewGenerator
* @param UrlShortenerInterface $urlShortener
*
* @Inject({PreviewGenerator::class, UrlShortener::class})
*/
public function __construct(PreviewGeneratorInterface $previewGenerator, UrlShortenerInterface $urlShortener)
{
$this->previewGenerator = $previewGenerator;

View File

@@ -1,7 +1,6 @@
<?php
namespace Shlinkio\Shlink\Core\Action;
use Acelaya\ZsmAnnotatedServices\Annotation\Inject;
use Endroid\QrCode\QrCode;
use Interop\Http\ServerMiddleware\DelegateInterface;
use Interop\Http\ServerMiddleware\MiddlewareInterface;
@@ -11,7 +10,6 @@ use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
use Shlinkio\Shlink\Common\Response\QrCodeResponse;
use Shlinkio\Shlink\Core\Exception\InvalidShortCodeException;
use Shlinkio\Shlink\Core\Service\UrlShortener;
use Shlinkio\Shlink\Core\Service\UrlShortenerInterface;
use Zend\Expressive\Router\RouterInterface;
@@ -30,14 +28,6 @@ class QrCodeAction implements MiddlewareInterface
*/
private $logger;
/**
* QrCodeAction constructor.
* @param RouterInterface $router
* @param UrlShortenerInterface $urlShortener
* @param LoggerInterface $logger
*
* @Inject({RouterInterface::class, UrlShortener::class, "Logger_Shlink"})
*/
public function __construct(
RouterInterface $router,
UrlShortenerInterface $urlShortener,

View File

@@ -1,16 +1,13 @@
<?php
namespace Shlinkio\Shlink\Core\Action;
use Acelaya\ZsmAnnotatedServices\Annotation\Inject;
use Interop\Http\ServerMiddleware\DelegateInterface;
use Interop\Http\ServerMiddleware\MiddlewareInterface;
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
use Shlinkio\Shlink\Core\Service\UrlShortener;
use Shlinkio\Shlink\Core\Service\UrlShortenerInterface;
use Shlinkio\Shlink\Core\Service\VisitsTracker;
use Shlinkio\Shlink\Core\Service\VisitsTrackerInterface;
use Zend\Diactoros\Response\RedirectResponse;
@@ -29,14 +26,6 @@ class RedirectAction implements MiddlewareInterface
*/
private $logger;
/**
* RedirectMiddleware constructor.
* @param UrlShortenerInterface $urlShortener
* @param VisitsTrackerInterface $visitTracker
* @param LoggerInterface|null $logger
*
* @Inject({UrlShortener::class, VisitsTracker::class, "Logger_Shlink"})
*/
public function __construct(
UrlShortenerInterface $urlShortener,
VisitsTrackerInterface $visitTracker,