Code Duplication    Length = 16-16 lines in 2 locations

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

@@ 236-251 (lines=16) @@
233
     *
234
     * @throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException if the authenticated user is not allowed to create a user group
235
     */
236
    public function deleteUserGroup(APIUserGroup $userGroup)
237
    {
238
        $loadedUserGroup = $this->loadUserGroup($userGroup->id);
239
240
        $this->repository->beginTransaction();
241
        try {
242
            //@todo: what happens to sub user groups and users below sub user groups
243
            $affectedLocationIds = $this->repository->getContentService()->deleteContent($loadedUserGroup->getVersionInfo()->getContentInfo());
244
            $this->repository->commit();
245
        } catch (Exception $e) {
246
            $this->repository->rollback();
247
            throw $e;
248
        }
249
250
        return $affectedLocationIds;
251
    }
252
253
    /**
254
     * Moves the user group to another parent.
@@ 650-665 (lines=16) @@
647
     *
648
     * @throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException if the authenticated user is not allowed to delete the user
649
     */
650
    public function deleteUser(APIUser $user)
651
    {
652
        $loadedUser = $this->loadUser($user->id);
653
654
        $this->repository->beginTransaction();
655
        try {
656
            $affectedLocationIds = $this->repository->getContentService()->deleteContent($loadedUser->getVersionInfo()->getContentInfo());
657
            $this->userHandler->delete($loadedUser->id);
658
            $this->repository->commit();
659
        } catch (Exception $e) {
660
            $this->repository->rollback();
661
            throw $e;
662
        }
663
664
        return $affectedLocationIds;
665
    }
666
667
    /**
668
     * Updates a user.