Code Duplication    Length = 8-10 lines in 2 locations

eZ/Publish/Core/Repository/UserService.php 2 locations

@@ 320-329 (lines=10) @@
317
        $this->repository->beginTransaction();
318
        try {
319
            $publishedContent = $loadedUserGroup;
320
            if ($userGroupUpdateStruct->contentUpdateStruct !== null) {
321
                $contentDraft = $contentService->createContentDraft($loadedUserGroup->getVersionInfo()->getContentInfo());
322
323
                $contentDraft = $contentService->updateContent(
324
                    $contentDraft->getVersionInfo(),
325
                    $userGroupUpdateStruct->contentUpdateStruct
326
                );
327
328
                $publishedContent = $contentService->publishVersion($contentDraft->getVersionInfo());
329
            }
330
331
            if ($userGroupUpdateStruct->contentMetadataUpdateStruct !== null) {
332
                $publishedContent = $contentService->updateContentMetadata(
@@ 717-724 (lines=8) @@
714
        $this->repository->beginTransaction();
715
        try {
716
            $publishedContent = $loadedUser;
717
            if ($userUpdateStruct->contentUpdateStruct !== null) {
718
                $contentDraft = $contentService->createContentDraft($loadedUser->getVersionInfo()->getContentInfo());
719
                $contentDraft = $contentService->updateContent(
720
                    $contentDraft->getVersionInfo(),
721
                    $userUpdateStruct->contentUpdateStruct
722
                );
723
                $publishedContent = $contentService->publishVersion($contentDraft->getVersionInfo());
724
            }
725
726
            if ($userUpdateStruct->contentMetadataUpdateStruct !== null) {
727
                $contentService->updateContentMetadata(