Code Duplication    Length = 8-10 lines in 2 locations

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

@@ 323-332 (lines=10) @@
320
        $this->repository->beginTransaction();
321
        try {
322
            $publishedContent = $loadedUserGroup;
323
            if ($userGroupUpdateStruct->contentUpdateStruct !== null) {
324
                $contentDraft = $contentService->createContentDraft($loadedUserGroup->getVersionInfo()->getContentInfo());
325
326
                $contentDraft = $contentService->updateContent(
327
                    $contentDraft->getVersionInfo(),
328
                    $userGroupUpdateStruct->contentUpdateStruct
329
                );
330
331
                $publishedContent = $contentService->publishVersion($contentDraft->getVersionInfo());
332
            }
333
334
            if ($userGroupUpdateStruct->contentMetadataUpdateStruct !== null) {
335
                $publishedContent = $contentService->updateContentMetadata(
@@ 745-752 (lines=8) @@
742
        $this->repository->beginTransaction();
743
        try {
744
            $publishedContent = $loadedUser;
745
            if ($userUpdateStruct->contentUpdateStruct !== null) {
746
                $contentDraft = $contentService->createContentDraft($loadedUser->getVersionInfo()->getContentInfo());
747
                $contentDraft = $contentService->updateContent(
748
                    $contentDraft->getVersionInfo(),
749
                    $userUpdateStruct->contentUpdateStruct
750
                );
751
                $publishedContent = $contentService->publishVersion($contentDraft->getVersionInfo());
752
            }
753
754
            if ($userUpdateStruct->contentMetadataUpdateStruct !== null) {
755
                $contentService->updateContentMetadata(