Code Duplication    Length = 8-10 lines in 2 locations

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

@@ 331-340 (lines=10) @@
328
        $this->repository->beginTransaction();
329
        try {
330
            $publishedContent = $loadedUserGroup;
331
            if ($userGroupUpdateStruct->contentUpdateStruct !== null) {
332
                $contentDraft = $contentService->createContentDraft($loadedUserGroup->getVersionInfo()->getContentInfo());
333
334
                $contentDraft = $contentService->updateContent(
335
                    $contentDraft->getVersionInfo(),
336
                    $userGroupUpdateStruct->contentUpdateStruct
337
                );
338
339
                $publishedContent = $contentService->publishVersion($contentDraft->getVersionInfo());
340
            }
341
342
            if ($userGroupUpdateStruct->contentMetadataUpdateStruct !== null) {
343
                $publishedContent = $contentService->updateContentMetadata(
@@ 765-772 (lines=8) @@
762
        $this->repository->beginTransaction();
763
        try {
764
            $publishedContent = $loadedUser;
765
            if ($userUpdateStruct->contentUpdateStruct !== null) {
766
                $contentDraft = $contentService->createContentDraft($loadedUser->getVersionInfo()->getContentInfo());
767
                $contentDraft = $contentService->updateContent(
768
                    $contentDraft->getVersionInfo(),
769
                    $userUpdateStruct->contentUpdateStruct
770
                );
771
                $publishedContent = $contentService->publishVersion($contentDraft->getVersionInfo());
772
            }
773
774
            if ($userUpdateStruct->contentMetadataUpdateStruct !== null) {
775
                $contentService->updateContentMetadata(