Code Duplication    Length = 16-16 lines in 2 locations

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

@@ 233-248 (lines=16) @@
230
     *
231
     * @throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException if the authenticated user is not allowed to create a user group
232
     */
233
    public function deleteUserGroup(APIUserGroup $userGroup)
234
    {
235
        $loadedUserGroup = $this->loadUserGroup($userGroup->id);
236
237
        $this->repository->beginTransaction();
238
        try {
239
            //@todo: what happens to sub user groups and users below sub user groups
240
            $affectedLocationIds = $this->repository->getContentService()->deleteContent($loadedUserGroup->getVersionInfo()->getContentInfo());
241
            $this->repository->commit();
242
        } catch (Exception $e) {
243
            $this->repository->rollback();
244
            throw $e;
245
        }
246
247
        return $affectedLocationIds;
248
    }
249
250
    /**
251
     * Moves the user group to another parent.
@@ 633-648 (lines=16) @@
630
     *
631
     * @throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException if the authenticated user is not allowed to delete the user
632
     */
633
    public function deleteUser(APIUser $user)
634
    {
635
        $loadedUser = $this->loadUser($user->id);
636
637
        $this->repository->beginTransaction();
638
        try {
639
            $affectedLocationIds = $this->repository->getContentService()->deleteContent($loadedUser->getVersionInfo()->getContentInfo());
640
            $this->userHandler->delete($loadedUser->id);
641
            $this->repository->commit();
642
        } catch (Exception $e) {
643
            $this->repository->rollback();
644
            throw $e;
645
        }
646
647
        return $affectedLocationIds;
648
    }
649
650
    /**
651
     * Updates a user.