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(
@@ 734-741 (lines=8) @@
731
        $this->repository->beginTransaction();
732
        try {
733
            $publishedContent = $loadedUser;
734
            if ($userUpdateStruct->contentUpdateStruct !== null) {
735
                $contentDraft = $contentService->createContentDraft($loadedUser->getVersionInfo()->getContentInfo());
736
                $contentDraft = $contentService->updateContent(
737
                    $contentDraft->getVersionInfo(),
738
                    $userUpdateStruct->contentUpdateStruct
739
                );
740
                $publishedContent = $contentService->publishVersion($contentDraft->getVersionInfo());
741
            }
742
743
            if ($userUpdateStruct->contentMetadataUpdateStruct !== null) {
744
                $contentService->updateContentMetadata(