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(
@@ 723-730 (lines=8) @@
720
        $this->repository->beginTransaction();
721
        try {
722
            $publishedContent = $loadedUser;
723
            if ($userUpdateStruct->contentUpdateStruct !== null) {
724
                $contentDraft = $contentService->createContentDraft($loadedUser->getVersionInfo()->getContentInfo());
725
                $contentDraft = $contentService->updateContent(
726
                    $contentDraft->getVersionInfo(),
727
                    $userUpdateStruct->contentUpdateStruct
728
                );
729
                $publishedContent = $contentService->publishVersion($contentDraft->getVersionInfo());
730
            }
731
732
            if ($userUpdateStruct->contentMetadataUpdateStruct !== null) {
733
                $contentService->updateContentMetadata(