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(
@@ 714-721 (lines=8) @@
711
        $this->repository->beginTransaction();
712
        try {
713
            $publishedContent = $loadedUser;
714
            if ($userUpdateStruct->contentUpdateStruct !== null) {
715
                $contentDraft = $contentService->createContentDraft($loadedUser->getVersionInfo()->getContentInfo());
716
                $contentDraft = $contentService->updateContent(
717
                    $contentDraft->getVersionInfo(),
718
                    $userUpdateStruct->contentUpdateStruct
719
                );
720
                $publishedContent = $contentService->publishVersion($contentDraft->getVersionInfo());
721
            }
722
723
            if ($userUpdateStruct->contentMetadataUpdateStruct !== null) {
724
                $contentService->updateContentMetadata(