Code Duplication    Length = 8-10 lines in 2 locations

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

@@ 733-740 (lines=8) @@
730
        $this->repository->beginTransaction();
731
        try {
732
            $publishedContent = $loadedUser;
733
            if ($userUpdateStruct->contentUpdateStruct !== null) {
734
                $contentDraft = $contentService->createContentDraft($loadedUser->getVersionInfo()->getContentInfo());
735
                $contentDraft = $contentService->updateContent(
736
                    $contentDraft->getVersionInfo(),
737
                    $userUpdateStruct->contentUpdateStruct
738
                );
739
                $publishedContent = $contentService->publishVersion($contentDraft->getVersionInfo());
740
            }
741
742
            if ($userUpdateStruct->contentMetadataUpdateStruct !== null) {
743
                $contentService->updateContentMetadata(
@@ 322-331 (lines=10) @@
319
        $this->repository->beginTransaction();
320
        try {
321
            $publishedContent = $loadedUserGroup;
322
            if ($userGroupUpdateStruct->contentUpdateStruct !== null) {
323
                $contentDraft = $contentService->createContentDraft($loadedUserGroup->getVersionInfo()->getContentInfo());
324
325
                $contentDraft = $contentService->updateContent(
326
                    $contentDraft->getVersionInfo(),
327
                    $userGroupUpdateStruct->contentUpdateStruct
328
                );
329
330
                $publishedContent = $contentService->publishVersion($contentDraft->getVersionInfo());
331
            }
332
333
            if ($userGroupUpdateStruct->contentMetadataUpdateStruct !== null) {
334
                $publishedContent = $contentService->updateContentMetadata(