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(
@@ 753-760 (lines=8) @@
750
        $this->repository->beginTransaction();
751
        try {
752
            $publishedContent = $loadedUser;
753
            if ($userUpdateStruct->contentUpdateStruct !== null) {
754
                $contentDraft = $contentService->createContentDraft($loadedUser->getVersionInfo()->getContentInfo());
755
                $contentDraft = $contentService->updateContent(
756
                    $contentDraft->getVersionInfo(),
757
                    $userUpdateStruct->contentUpdateStruct
758
                );
759
                $publishedContent = $contentService->publishVersion($contentDraft->getVersionInfo());
760
            }
761
762
            if ($userUpdateStruct->contentMetadataUpdateStruct !== null) {
763
                $contentService->updateContentMetadata(