Code Duplication    Length = 16-16 lines in 2 locations

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

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