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.
@@ 669-684 (lines=16) @@
666
     *
667
     * @throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException if the authenticated user is not allowed to delete the user
668
     */
669
    public function deleteUser(APIUser $user)
670
    {
671
        $loadedUser = $this->loadUser($user->id);
672
673
        $this->repository->beginTransaction();
674
        try {
675
            $affectedLocationIds = $this->repository->getContentService()->deleteContent($loadedUser->getVersionInfo()->getContentInfo());
676
            $this->userHandler->delete($loadedUser->id);
677
            $this->repository->commit();
678
        } catch (Exception $e) {
679
            $this->repository->rollback();
680
            throw $e;
681
        }
682
683
        return $affectedLocationIds;
684
    }
685
686
    /**
687
     * Updates a user.