Code Duplication    Length = 16-16 lines in 2 locations

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

@@ 250-265 (lines=16) @@
247
     *
248
     * @throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException if the authenticated user is not allowed to create a user group
249
     */
250
    public function deleteUserGroup(APIUserGroup $userGroup)
251
    {
252
        $loadedUserGroup = $this->loadUserGroup($userGroup->id);
253
254
        $this->repository->beginTransaction();
255
        try {
256
            //@todo: what happens to sub user groups and users below sub user groups
257
            $affectedLocationIds = $this->repository->getContentService()->deleteContent($loadedUserGroup->getVersionInfo()->getContentInfo());
258
            $this->repository->commit();
259
        } catch (Exception $e) {
260
            $this->repository->rollback();
261
            throw $e;
262
        }
263
264
        return $affectedLocationIds;
265
    }
266
267
    /**
268
     * Moves the user group to another parent.
@@ 711-726 (lines=16) @@
708
     *
709
     * @throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException if the authenticated user is not allowed to delete the user
710
     */
711
    public function deleteUser(APIUser $user)
712
    {
713
        $loadedUser = $this->loadUser($user->id);
714
715
        $this->repository->beginTransaction();
716
        try {
717
            $affectedLocationIds = $this->repository->getContentService()->deleteContent($loadedUser->getVersionInfo()->getContentInfo());
718
            $this->userHandler->delete($loadedUser->id);
719
            $this->repository->commit();
720
        } catch (Exception $e) {
721
            $this->repository->rollback();
722
            throw $e;
723
        }
724
725
        return $affectedLocationIds;
726
    }
727
728
    /**
729
     * Updates a user.