Code Duplication    Length = 16-16 lines in 2 locations

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

@@ 244-259 (lines=16) @@
241
     *
242
     * @throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException if the authenticated user is not allowed to create a user group
243
     */
244
    public function deleteUserGroup(APIUserGroup $userGroup)
245
    {
246
        $loadedUserGroup = $this->loadUserGroup($userGroup->id);
247
248
        $this->repository->beginTransaction();
249
        try {
250
            //@todo: what happens to sub user groups and users below sub user groups
251
            $affectedLocationIds = $this->repository->getContentService()->deleteContent($loadedUserGroup->getVersionInfo()->getContentInfo());
252
            $this->repository->commit();
253
        } catch (Exception $e) {
254
            $this->repository->rollback();
255
            throw $e;
256
        }
257
258
        return $affectedLocationIds;
259
    }
260
261
    /**
262
     * Moves the user group to another parent.
@@ 681-696 (lines=16) @@
678
     *
679
     * @throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException if the authenticated user is not allowed to delete the user
680
     */
681
    public function deleteUser(APIUser $user)
682
    {
683
        $loadedUser = $this->loadUser($user->id);
684
685
        $this->repository->beginTransaction();
686
        try {
687
            $affectedLocationIds = $this->repository->getContentService()->deleteContent($loadedUser->getVersionInfo()->getContentInfo());
688
            $this->userHandler->delete($loadedUser->id);
689
            $this->repository->commit();
690
        } catch (Exception $e) {
691
            $this->repository->rollback();
692
            throw $e;
693
        }
694
695
        return $affectedLocationIds;
696
    }
697
698
    /**
699
     * Updates a user.