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