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