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.
@@ 637-650 (lines=14) @@
634
     *
635
     * @throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException if the authenticated user is not allowed to delete the user
636
     */
637
    public function deleteUser(APIUser $user)
638
    {
639
        $loadedUser = $this->loadUser($user->id);
640
641
        $this->repository->beginTransaction();
642
        try {
643
            $this->repository->getContentService()->deleteContent($loadedUser->getVersionInfo()->getContentInfo());
644
            $this->userHandler->delete($loadedUser->id);
645
            $this->repository->commit();
646
        } catch (Exception $e) {
647
            $this->repository->rollback();
648
            throw $e;
649
        }
650
    }
651
652
    /**
653
     * Updates a user.