Code Duplication    Length = 9-9 lines in 2 locations

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

@@ 197-205 (lines=9) @@
194
        $contentIds = [];
195
        $contentTypeIds = [];
196
        $translations = $prioritizedLanguages;
197
        foreach ($infoList as $info) {
198
            $contentIds[] = $info->id;
199
            $contentTypeIds[] = $info->contentTypeId;
200
            // Unless we are told to load all languages, we add main language to translations so they are loaded too
201
            // Might in some case load more languages then intended, but prioritised handling will pick right one
202
            if (!empty($prioritizedLanguages) && $useAlwaysAvailable && $info->alwaysAvailable) {
203
                $translations[] = $info->mainLanguageCode;
204
            }
205
        }
206
207
        unset($infoList);
208

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

@@ 463-471 (lines=9) @@
460
        $contentIds = [];
461
        $contentTypeIds = [];
462
        $translations = $languages;
463
        foreach ($contentInfoList as $contentInfo) {
464
            $contentIds[] = $contentInfo->id;
465
            $contentTypeIds[] = $contentInfo->contentTypeId;
466
            // Unless we are told to load all languages, we add main language to translations so they are loaded too
467
            // Might in some case load more languages then intended, but prioritised handling will pick right one
468
            if (!$loadAllLanguages && $useAlwaysAvailable && $contentInfo->alwaysAvailable) {
469
                $translations[] = $contentInfo->mainLanguageCode;
470
            }
471
        }
472
473
        $contentList = [];
474
        $translations = array_unique($translations);