From 963f50bf2e7e32a80ab2b0273cd22045299a8d7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20W=C3=B3js?= Date: Tue, 18 Jul 2017 10:40:44 +0200 Subject: [PATCH] EZP-27666: Services should depend upon UrlRedecoratorInterface instead of UrlRedecorator (#2056) * EZP-27666: Services should depend upon UrlRedecoratorInterface instead of UrlRedecorator * fixup! EZP-27666: Services should depend upon UrlRedecoratorInterface instead of UrlRedecorator --- .../Image/ImageStorage/Gateway/DoctrineStorage.php | 6 +++--- .../Image/ImageStorage/Gateway/LegacyStorage.php | 6 +++--- .../Content/FieldValue/Converter/ImageConverter.php | 8 ++++---- eZ/Publish/SPI/Tests/FieldType/ImageIntegrationTest.php | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/eZ/Publish/Core/FieldType/Image/ImageStorage/Gateway/DoctrineStorage.php b/eZ/Publish/Core/FieldType/Image/ImageStorage/Gateway/DoctrineStorage.php index 24734b0367b..62c1bebd1af 100644 --- a/eZ/Publish/Core/FieldType/Image/ImageStorage/Gateway/DoctrineStorage.php +++ b/eZ/Publish/Core/FieldType/Image/ImageStorage/Gateway/DoctrineStorage.php @@ -10,7 +10,7 @@ use Doctrine\DBAL\Connection; use DOMDocument; -use eZ\Publish\Core\IO\UrlRedecorator; +use eZ\Publish\Core\IO\UrlRedecoratorInterface; use eZ\Publish\SPI\Persistence\Content\VersionInfo; use eZ\Publish\Core\FieldType\Image\ImageStorage\Gateway; use PDO; @@ -41,11 +41,11 @@ class DoctrineStorage extends Gateway ]; /** - * @var \eZ\Publish\Core\IO\UrlRedecorator + * @var \eZ\Publish\Core\IO\UrlRedecoratorInterface */ private $redecorator; - public function __construct(UrlRedecorator $redecorator, Connection $connection) + public function __construct(UrlRedecoratorInterface $redecorator, Connection $connection) { $this->redecorator = $redecorator; $this->connection = $connection; diff --git a/eZ/Publish/Core/FieldType/Image/ImageStorage/Gateway/LegacyStorage.php b/eZ/Publish/Core/FieldType/Image/ImageStorage/Gateway/LegacyStorage.php index 2e39e555f4e..57bf9afd689 100644 --- a/eZ/Publish/Core/FieldType/Image/ImageStorage/Gateway/LegacyStorage.php +++ b/eZ/Publish/Core/FieldType/Image/ImageStorage/Gateway/LegacyStorage.php @@ -8,7 +8,7 @@ */ namespace eZ\Publish\Core\FieldType\Image\ImageStorage\Gateway; -use eZ\Publish\Core\IO\UrlRedecorator; +use eZ\Publish\Core\IO\UrlRedecoratorInterface; use eZ\Publish\Core\Persistence\Database\DatabaseHandler; use eZ\Publish\SPI\Persistence\Content\VersionInfo; use eZ\Publish\Core\FieldType\Image\ImageStorage\Gateway; @@ -37,11 +37,11 @@ class LegacyStorage extends Gateway ]; /** - * @var \eZ\Publish\Core\IO\UrlRedecorator + * @var \eZ\Publish\Core\IO\UrlRedecoratorInterface */ private $redecorator; - public function __construct(UrlRedecorator $redecorator, DatabaseHandler $dbHandler) + public function __construct(UrlRedecoratorInterface $redecorator, DatabaseHandler $dbHandler) { @trigger_error( sprintf('%s is deprecated, use %s instead', self::class, DoctrineStorage::class), diff --git a/eZ/Publish/Core/Persistence/Legacy/Content/FieldValue/Converter/ImageConverter.php b/eZ/Publish/Core/Persistence/Legacy/Content/FieldValue/Converter/ImageConverter.php index 012391b1d42..e6f4c9703e6 100644 --- a/eZ/Publish/Core/Persistence/Legacy/Content/FieldValue/Converter/ImageConverter.php +++ b/eZ/Publish/Core/Persistence/Legacy/Content/FieldValue/Converter/ImageConverter.php @@ -9,7 +9,7 @@ namespace eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\Converter; use eZ\Publish\Core\IO\IOServiceInterface; -use eZ\Publish\Core\IO\UrlRedecorator; +use eZ\Publish\Core\IO\UrlRedecoratorInterface; use eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\Converter; use eZ\Publish\Core\Persistence\Legacy\Content\StorageFieldValue; use eZ\Publish\SPI\Persistence\Content\FieldValue; @@ -19,13 +19,13 @@ class ImageConverter implements Converter { - /** @var IOServiceInterface */ + /** @var \eZ\Publish\Core\IO\IOServiceInterface */ private $imageIoService; - /** @var UrlRedecorator */ + /** @var \eZ\Publish\Core\IO\UrlRedecoratorInterface */ private $urlRedecorator; - public function __construct(IOServiceInterface $imageIoService, UrlRedecorator $urlRedecorator) + public function __construct(IOServiceInterface $imageIoService, UrlRedecoratorInterface $urlRedecorator) { $this->imageIoService = $imageIoService; $this->urlRedecorator = $urlRedecorator; diff --git a/eZ/Publish/SPI/Tests/FieldType/ImageIntegrationTest.php b/eZ/Publish/SPI/Tests/FieldType/ImageIntegrationTest.php index 38098b29def..ba6a3a0a9bb 100644 --- a/eZ/Publish/SPI/Tests/FieldType/ImageIntegrationTest.php +++ b/eZ/Publish/SPI/Tests/FieldType/ImageIntegrationTest.php @@ -76,9 +76,9 @@ public function getCustomHandler() $fieldType = new FieldType\Image\Type(); $fieldType->setTransformationProcessor($this->getTransformationProcessor()); - $urlRedecorator = self::$container->get('ezpublish.core.io.image_fieldtype.legacy_url_redecorator'); - /** @var \eZ\Publish\Core\IO\UrlRedecorator $urlRedecorator */ $this->ioService = self::$container->get('ezpublish.fieldType.ezimage.io_service'); + /** @var \eZ\Publish\Core\IO\UrlRedecoratorInterface $urlRedecorator */ + $urlRedecorator = self::$container->get('ezpublish.core.io.image_fieldtype.legacy_url_redecorator'); return $this->getHandler( 'ezimage',