Code Duplication    Length = 8-10 lines in 2 locations

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

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