Code Duplication    Length = 8-8 lines in 2 locations

eZ/Publish/Core/Repository/UserService.php 2 locations

@@ 198-205 (lines=8) @@
195
        }
196
197
        $subUserGroups = [];
198
        foreach ($searchResult->searchHits as $searchHit) {
199
            $subUserGroups[] = $this->buildDomainUserGroupObject(
200
                $this->repository->getContentService()->internalLoadContent(
201
                    $searchHit->valueObject->contentInfo->id,
202
                    $prioritizedLanguages
203
                )
204
            );
205
        }
206
207
        return $subUserGroups;
208
    }
@@ 956-963 (lines=8) @@
953
        $searchResult = $this->repository->getSearchService()->findLocations($searchQuery);
954
955
        $userGroups = [];
956
        foreach ($searchResult->searchHits as $resultItem) {
957
            $userGroups[] = $this->buildDomainUserGroupObject(
958
                $this->repository->getContentService()->internalLoadContent(
959
                    $resultItem->valueObject->contentInfo->id,
960
                    $prioritizedLanguages
961
                )
962
            );
963
        }
964
965
        return $userGroups;
966
    }