diff --git a/eZ/Publish/Core/settings/storage_engines/legacy/content.yml b/eZ/Publish/Core/settings/storage_engines/legacy/content.yml deleted file mode 100644 index 2a956461b7..0000000000 --- a/eZ/Publish/Core/settings/storage_engines/legacy/content.yml +++ /dev/null @@ -1,73 +0,0 @@ -services: - ezpublish.persistence.legacy.content.query_builder: - class: eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase\QueryBuilder - arguments: - $connection: '@ezpublish.api.storage_engine.legacy.connection' - - ezpublish.persistence.legacy.content.mapper: - class: eZ\Publish\Core\Persistence\Legacy\Content\Mapper - arguments: - - "@ezpublish.persistence.legacy.field_value_converter.registry" - - "@ezpublish.spi.persistence.legacy.language.handler" - - '@ezpublish.spi.persistence.legacy.content_type.handler' - - '@Symfony\Contracts\EventDispatcher\EventDispatcherInterface' - - Ibexa\Core\Persistence\Legacy\Content\Mapper\ResolveVirtualFieldSubscriber: - arguments: - $converterRegistry: '@ezpublish.persistence.legacy.field_value_converter.registry' - $storageRegistry: '@ezpublish.persistence.external_storage_registry' - $contentGateway: '@ezpublish.persistence.legacy.content.gateway' - tags: - - { name: kernel.event_subscriber } - - ezpublish.persistence.legacy.content.gateway.inner: - class: eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase - arguments: - - "@ezpublish.api.storage_engine.legacy.connection" - - '@eZ\Publish\Core\Persistence\Legacy\SharedGateway\Gateway' - - "@ezpublish.persistence.legacy.content.query_builder" - - "@ezpublish.spi.persistence.legacy.language.handler" - - "@ezpublish.persistence.legacy.language.mask_generator" - - ezpublish.persistence.legacy.content.gateway.exception_conversion: - class: eZ\Publish\Core\Persistence\Legacy\Content\Gateway\ExceptionConversion - arguments: - - "@ezpublish.persistence.legacy.content.gateway.inner" - - # To disable exception conversion layer override this alias so that it points to inner gateway - ezpublish.persistence.legacy.content.gateway: - alias: ezpublish.persistence.legacy.content.gateway.exception_conversion - - ezpublish.persistence.legacy.field_handler: - class: eZ\Publish\Core\Persistence\Legacy\Content\FieldHandler - arguments: - - "@ezpublish.persistence.legacy.content.gateway" - - "@ezpublish.persistence.legacy.content.mapper" - - "@ezpublish.persistence.legacy.external_storage_handler" - - "@ezpublish.spi.persistence.legacy.language.handler" - - "@ezpublish.persistence.field_type_registry" - lazy: true - - ezpublish.persistence.legacy.tree_handler: - class: eZ\Publish\Core\Persistence\Legacy\Content\TreeHandler - arguments: - - "@ezpublish.persistence.legacy.location.gateway" - - "@ezpublish.persistence.legacy.location.mapper" - - "@ezpublish.persistence.legacy.content.gateway" - - "@ezpublish.persistence.legacy.content.mapper" - - "@ezpublish.persistence.legacy.field_handler" - - ezpublish.spi.persistence.legacy.content.handler: - class: eZ\Publish\Core\Persistence\Legacy\Content\Handler - arguments: - - "@ezpublish.persistence.legacy.content.gateway" - - "@ezpublish.persistence.legacy.location.gateway" - - "@ezpublish.persistence.legacy.content.mapper" - - "@ezpublish.persistence.legacy.field_handler" - - "@ezpublish.persistence.slug_converter" - - "@ezpublish.persistence.legacy.url_alias.gateway" - - "@ezpublish.spi.persistence.legacy.content_type.handler" - - "@ezpublish.persistence.legacy.tree_handler" - - "@ezpublish.spi.persistence.legacy.language.handler" - - "@logger" - lazy: true diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 43e60a3254..8c33e839fe 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -14905,21 +14905,6 @@ parameters: count: 1 path: src/lib/Persistence/Legacy/Bookmark/Mapper.php - - - message: "#^Access to an undefined property object\\:\\:\\$languageCode\\.$#" - count: 1 - path: src/lib/Persistence/Legacy/Content/FieldHandler.php - - - - message: "#^Cannot access offset int\\|string on Ibexa\\\\Contracts\\\\Core\\\\Persistence\\\\Content\\\\Field\\.$#" - count: 3 - path: src/lib/Persistence/Legacy/Content/FieldHandler.php - - - - message: "#^Cannot access offset string on Ibexa\\\\Contracts\\\\Core\\\\Persistence\\\\Content\\\\Field\\.$#" - count: 5 - path: src/lib/Persistence/Legacy/Content/FieldHandler.php - - message: "#^Method Ibexa\\\\Core\\\\Persistence\\\\Legacy\\\\Content\\\\FieldHandler\\:\\:copyField\\(\\) has no return type specified\\.$#" count: 1 @@ -14970,11 +14955,6 @@ parameters: count: 1 path: src/lib/Persistence/Legacy/Content/FieldHandler.php - - - message: "#^Method Ibexa\\\\Core\\\\Persistence\\\\Legacy\\\\Content\\\\FieldHandler\\:\\:getFieldMap\\(\\) should return array\\ but returns array\\\\>\\.$#" - count: 1 - path: src/lib/Persistence/Legacy/Content/FieldHandler.php - - message: "#^Method Ibexa\\\\Core\\\\Persistence\\\\Legacy\\\\Content\\\\FieldHandler\\:\\:loadExternalFieldData\\(\\) has no return type specified\\.$#" count: 1 @@ -14995,18 +14975,13 @@ parameters: count: 1 path: src/lib/Persistence/Legacy/Content/FieldHandler.php - - - message: "#^Parameter \\#1 \\$field of method Ibexa\\\\Core\\\\Persistence\\\\Legacy\\\\Content\\\\FieldHandler\\:\\:updateField\\(\\) expects Ibexa\\\\Contracts\\\\Core\\\\Persistence\\\\Content\\\\Field, object given\\.$#" - count: 1 - path: src/lib/Persistence/Legacy/Content/FieldHandler.php - - message: "#^Parameter \\#2 \\$languageCode of method Ibexa\\\\Core\\\\Persistence\\\\Legacy\\\\Content\\\\FieldHandler\\:\\:getEmptyField\\(\\) expects string, int\\|string given\\.$#" count: 2 path: src/lib/Persistence/Legacy/Content/FieldHandler.php - - message: "#^Parameter \\#3 \\$originalField of method Ibexa\\\\Core\\\\Persistence\\\\Legacy\\\\Content\\\\FieldHandler\\:\\:updateCopiedField\\(\\) expects Ibexa\\\\Contracts\\\\Core\\\\Persistence\\\\Content\\\\Field, object given\\.$#" + message: "#^Property Ibexa\\\\Contracts\\\\Core\\\\Persistence\\\\Content\\\\Field\\:\\:\\$id \\(int\\) in isset\\(\\) is not nullable\\.$#" count: 1 path: src/lib/Persistence/Legacy/Content/FieldHandler.php diff --git a/src/lib/Persistence/Legacy/Content/FieldHandler.php b/src/lib/Persistence/Legacy/Content/FieldHandler.php index 816df404a0..892608c25c 100644 --- a/src/lib/Persistence/Legacy/Content/FieldHandler.php +++ b/src/lib/Persistence/Legacy/Content/FieldHandler.php @@ -424,7 +424,7 @@ protected function updateCopiedField(Field $field, Field $updateField, Field $or * @param \Ibexa\Contracts\Core\Persistence\Content\Field[] $fields * @param array $languageCodes * - * @return array + * @return array> */ protected function getFieldMap(array $fields, &$languageCodes = null) { diff --git a/src/lib/Persistence/Legacy/Content/Handler.php b/src/lib/Persistence/Legacy/Content/Handler.php index 610f722996..56871b0d27 100644 --- a/src/lib/Persistence/Legacy/Content/Handler.php +++ b/src/lib/Persistence/Legacy/Content/Handler.php @@ -85,10 +85,7 @@ class Handler implements BaseContentHandler */ protected $treeHandler; - /** - * @var \eZ\Publish\SPI\Persistence\Content\Language\Handler - */ - protected $languageHandler; + protected LanguageHandler $languageHandler; /** @var \Psr\Log\LoggerInterface */ private $logger; diff --git a/src/lib/Persistence/Legacy/Content/Mapper.php b/src/lib/Persistence/Legacy/Content/Mapper.php index 3508c25656..aa6a670a66 100644 --- a/src/lib/Persistence/Legacy/Content/Mapper.php +++ b/src/lib/Persistence/Legacy/Content/Mapper.php @@ -328,6 +328,8 @@ private function buildContentObjects( /** * @phpstan-param TRawContentRow[] $rows * + * @param string[]|null $translations + * * @phpstan-return TVersionedLanguageFieldDefinitionsMap * * @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException diff --git a/tests/lib/Persistence/Legacy/Content/ContentHandlerTest.php b/tests/lib/Persistence/Legacy/Content/ContentHandlerTest.php index 93cf5abb2d..bde1f77c6e 100644 --- a/tests/lib/Persistence/Legacy/Content/ContentHandlerTest.php +++ b/tests/lib/Persistence/Legacy/Content/ContentHandlerTest.php @@ -112,13 +112,11 @@ class ContentHandlerTest extends TestCase protected $contentTypeHandlerMock; /** - * @var \PHPUnit\Framework\MockObject\MockObject&\eZ\Publish\Core\Persistence\Legacy\Content\Language\Handler + * @var \PHPUnit\Framework\MockObject\MockObject&\Ibexa\Core\Persistence\Legacy\Content\Language\Handler */ - private $languageHandlerMock; + private LanguageHandler $languageHandlerMock; /** - * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Handler::create - * * @todo Current method way to complex to test, refactor! */ public function testCreate() @@ -1590,7 +1588,7 @@ protected function getContentTypeHandlerMock() } /** - * @return \PHPUnit\Framework\MockObject\MockObject&\eZ\Publish\Core\Persistence\Legacy\Content\Language\Handler + * @return \PHPUnit\Framework\MockObject\MockObject&\Ibexa\Core\Persistence\Legacy\Content\Language\Handler */ protected function getLanguageHandlerMock(): LanguageHandler {