Code Duplication    Length = 8-10 lines in 2 locations

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

@@ 334-343 (lines=10) @@
331
        $this->repository->beginTransaction();
332
        try {
333
            $publishedContent = $loadedUserGroup;
334
            if ($userGroupUpdateStruct->contentUpdateStruct !== null) {
335
                $contentDraft = $contentService->createContentDraft($loadedUserGroup->getVersionInfo()->getContentInfo());
336
337
                $contentDraft = $contentService->updateContent(
338
                    $contentDraft->getVersionInfo(),
339
                    $userGroupUpdateStruct->contentUpdateStruct
340
                );
341
342
                $publishedContent = $contentService->publishVersion($contentDraft->getVersionInfo());
343
            }
344
345
            if ($userGroupUpdateStruct->contentMetadataUpdateStruct !== null) {
346
                $publishedContent = $contentService->updateContentMetadata(
@@ 719-726 (lines=8) @@
716
        $this->repository->beginTransaction();
717
        try {
718
            $publishedContent = $loadedUser;
719
            if ($userUpdateStruct->contentUpdateStruct !== null) {
720
                $contentDraft = $contentService->createContentDraft($loadedUser->getVersionInfo()->getContentInfo());
721
                $contentDraft = $contentService->updateContent(
722
                    $contentDraft->getVersionInfo(),
723
                    $userUpdateStruct->contentUpdateStruct
724
                );
725
                $publishedContent = $contentService->publishVersion($contentDraft->getVersionInfo());
726
            }
727
728
            if ($userUpdateStruct->contentMetadataUpdateStruct !== null) {
729
                $contentService->updateContentMetadata(