Code Duplication    Length = 14-14 lines in 2 locations

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

@@ 249-262 (lines=14) @@
246
     *
247
     * @throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException if the authenticated user is not allowed to create a user group
248
     */
249
    public function deleteUserGroup(APIUserGroup $userGroup)
250
    {
251
        $loadedUserGroup = $this->loadUserGroup($userGroup->id);
252
253
        $this->repository->beginTransaction();
254
        try {
255
            //@todo: what happens to sub user groups and users below sub user groups
256
            $this->repository->getContentService()->deleteContent($loadedUserGroup->getVersionInfo()->getContentInfo());
257
            $this->repository->commit();
258
        } catch (Exception $e) {
259
            $this->repository->rollback();
260
            throw $e;
261
        }
262
    }
263
264
    /**
265
     * Moves the user group to another parent.
@@ 647-660 (lines=14) @@
644
     *
645
     * @throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException if the authenticated user is not allowed to delete the user
646
     */
647
    public function deleteUser(APIUser $user)
648
    {
649
        $loadedUser = $this->loadUser($user->id);
650
651
        $this->repository->beginTransaction();
652
        try {
653
            $this->repository->getContentService()->deleteContent($loadedUser->getVersionInfo()->getContentInfo());
654
            $this->userHandler->delete($loadedUser->id);
655
            $this->repository->commit();
656
        } catch (Exception $e) {
657
            $this->repository->rollback();
658
            throw $e;
659
        }
660
    }
661
662
    /**
663
     * Updates a user.