Code Duplication    Length = 8-8 lines in 2 locations

eZ/Publish/Core/Repository/ContentService.php 1 location

@@ 455-462 (lines=8) @@
452
        $loadAllLanguages = $languages === Language::ALL;
453
        $contentIds = [];
454
        $translations = $languages;
455
        foreach ($contentInfoList as $contentInfo) {
456
            $contentIds[] = $contentInfo->id;
457
            // Unless we are told to load all languages, we add main language to translations so they are loaded too
458
            // Might in some case load more languages then intended, but prioritised handling will pick right one
459
            if (!$loadAllLanguages && $useAlwaysAvailable && $contentInfo->alwaysAvailable) {
460
                $translations[] = $contentInfo->mainLanguageCode;
461
            }
462
        }
463
        $translations = array_unique($translations);
464
465
        $spiContentList = $this->persistenceHandler->contentHandler()->loadContentList(

eZ/Publish/Core/Repository/Helper/DomainMapper.php 1 location

@@ 190-197 (lines=8) @@
187
    ): \Generator {
188
        $contentIds = [];
189
        $translations = $prioritizedLanguages;
190
        foreach ($infoList as $info) {
191
            $contentIds[] = $info->id;
192
            // Unless we are told to load all languages, we add main language to translations so they are loaded too
193
            // Might in some case load more languages then intended, but prioritised handling will pick right one
194
            if (!empty($prioritizedLanguages) && $useAlwaysAvailable && $info->alwaysAvailable) {
195
                $translations[] = $info->mainLanguageCode;
196
            }
197
        }
198
199
        $list = $this->contentHandler->loadContentList($contentIds, array_unique($translations));
200