From fa9ee6124c4c9df8403a6cba7feecfb5c206c4c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81=20R?= Date: Fri, 16 Nov 2018 19:38:45 +0100 Subject: [PATCH] Fix review comments --- eZ/Publish/Core/Persistence/Legacy/Content/Type/Gateway.php | 4 ++-- .../Legacy/Content/Type/Gateway/DoctrineDatabase.php | 2 +- .../Legacy/Content/Type/Gateway/ExceptionConversion.php | 4 ++-- eZ/Publish/Core/Persistence/Legacy/Content/Type/Handler.php | 2 +- .../Legacy/Tests/Content/Type/ContentTypeHandlerTest.php | 2 +- eZ/Publish/Core/Repository/Helper/DomainMapper.php | 5 +++-- eZ/Publish/SPI/Persistence/Content/Type/Handler.php | 2 +- 7 files changed, 11 insertions(+), 10 deletions(-) diff --git a/eZ/Publish/Core/Persistence/Legacy/Content/Type/Gateway.php b/eZ/Publish/Core/Persistence/Legacy/Content/Type/Gateway.php index 46e8dbe329d..edf2a07bb68 100644 --- a/eZ/Publish/Core/Persistence/Legacy/Content/Type/Gateway.php +++ b/eZ/Publish/Core/Persistence/Legacy/Content/Type/Gateway.php @@ -186,13 +186,13 @@ abstract public function updateFieldDefinition( abstract public function updateType($typeId, $status, UpdateStruct $updateStruct); /** - * Loads an array with data about several Types in defined status.. + * Loads an array with data about several Types in defined status. * * @param array $typeIds * * @return array Data rows. */ - abstract public function loadTypesDataList(array $typeIds): array; + abstract public function loadTypesListData(array $typeIds): array; /** * Loads an array with data about $typeId in $status. diff --git a/eZ/Publish/Core/Persistence/Legacy/Content/Type/Gateway/DoctrineDatabase.php b/eZ/Publish/Core/Persistence/Legacy/Content/Type/Gateway/DoctrineDatabase.php index 22019f49a32..3bccd5e30f5 100644 --- a/eZ/Publish/Core/Persistence/Legacy/Content/Type/Gateway/DoctrineDatabase.php +++ b/eZ/Publish/Core/Persistence/Legacy/Content/Type/Gateway/DoctrineDatabase.php @@ -870,7 +870,7 @@ public function updateType($typeId, $status, UpdateStruct $updateStruct) $this->insertTypeNameData($typeId, $status, $updateStruct->name); } - public function loadTypesDataList(array $typeIds): array + public function loadTypesListData(array $typeIds): array { $q = $this->getLoadTypeQueryBuilder(); $q diff --git a/eZ/Publish/Core/Persistence/Legacy/Content/Type/Gateway/ExceptionConversion.php b/eZ/Publish/Core/Persistence/Legacy/Content/Type/Gateway/ExceptionConversion.php index eb717b160c5..32085262268 100644 --- a/eZ/Publish/Core/Persistence/Legacy/Content/Type/Gateway/ExceptionConversion.php +++ b/eZ/Publish/Core/Persistence/Legacy/Content/Type/Gateway/ExceptionConversion.php @@ -350,10 +350,10 @@ public function updateType($typeId, $status, UpdateStruct $updateStruct) } } - public function loadTypesDataList(array $typeIds): array + public function loadTypesListData(array $typeIds): array { try { - return $this->innerGateway->loadTypesDataList($typeIds); + return $this->innerGateway->loadTypesListData($typeIds); } catch (PDOException | DBALException $e) { throw new RuntimeException('Database error', 0, $e); } diff --git a/eZ/Publish/Core/Persistence/Legacy/Content/Type/Handler.php b/eZ/Publish/Core/Persistence/Legacy/Content/Type/Handler.php index 9ccc574229a..c0f08b7a47d 100644 --- a/eZ/Publish/Core/Persistence/Legacy/Content/Type/Handler.php +++ b/eZ/Publish/Core/Persistence/Legacy/Content/Type/Handler.php @@ -190,7 +190,7 @@ public function loadContentTypes($groupId, $status = 0) public function loadContentTypeList(array $contentTypeIds): array { return $this->mapper->extractTypesFromRows( - $this->contentTypeGateway->loadTypesDataList($contentTypeIds), + $this->contentTypeGateway->loadTypesListData($contentTypeIds), true ); } diff --git a/eZ/Publish/Core/Persistence/Legacy/Tests/Content/Type/ContentTypeHandlerTest.php b/eZ/Publish/Core/Persistence/Legacy/Tests/Content/Type/ContentTypeHandlerTest.php index be7d340a79a..1a0178faeb7 100644 --- a/eZ/Publish/Core/Persistence/Legacy/Tests/Content/Type/ContentTypeHandlerTest.php +++ b/eZ/Publish/Core/Persistence/Legacy/Tests/Content/Type/ContentTypeHandlerTest.php @@ -307,7 +307,7 @@ public function testLoadContentTypeList(): void { $gatewayMock = $this->getGatewayMock(); $gatewayMock->expects($this->once()) - ->method('loadTypesDataList') + ->method('loadTypesListData') ->with($this->equalTo([23, 24])) ->willReturn([]); diff --git a/eZ/Publish/Core/Repository/Helper/DomainMapper.php b/eZ/Publish/Core/Repository/Helper/DomainMapper.php index 8d455000eba..9c64993d7c1 100644 --- a/eZ/Publish/Core/Repository/Helper/DomainMapper.php +++ b/eZ/Publish/Core/Repository/Helper/DomainMapper.php @@ -73,7 +73,7 @@ class DomainMapper protected $contentLanguageHandler; /** - * @var FieldTypeRegistry + * @var \eZ\Publish\Core\Repository\Helper\FieldTypeRegistry */ protected $fieldTypeRegistry; @@ -83,8 +83,9 @@ class DomainMapper * @param \eZ\Publish\SPI\Persistence\Content\Handler $contentHandler * @param \eZ\Publish\SPI\Persistence\Content\Location\Handler $locationHandler * @param \eZ\Publish\SPI\Persistence\Content\Type\Handler $contentTypeHandler + * @param \eZ\Publish\Core\Repository\Helper\ContentTypeDomainMapper $contentTypeDomainMapper * @param \eZ\Publish\SPI\Persistence\Content\Language\Handler $contentLanguageHandler - * @param FieldTypeRegistry $fieldTypeRegistry + * @param \eZ\Publish\Core\Repository\Helper\FieldTypeRegistry $fieldTypeRegistry */ public function __construct( ContentHandler $contentHandler, diff --git a/eZ/Publish/SPI/Persistence/Content/Type/Handler.php b/eZ/Publish/SPI/Persistence/Content/Type/Handler.php index d9bd0b1a608..d19c6faa044 100644 --- a/eZ/Publish/SPI/Persistence/Content/Type/Handler.php +++ b/eZ/Publish/SPI/Persistence/Content/Type/Handler.php @@ -87,7 +87,7 @@ public function loadContentTypes($groupId, $status = Type::STATUS_DEFINED); * Missing items (NotFound) will be missing from the array and not cause an exception, it's up * to calling logic to determine if this should cause exception or not. * - * @param mixed[] $contentTypeIds + * @param array $contentTypeIds * * @return \eZ\Publish\SPI\Persistence\Content\Type[] */