Code Duplication    Length = 11-13 lines in 2 locations

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

@@ 496-508 (lines=13) @@
493
     *
494
     * @param \eZ\Publish\API\Repository\Values\User\RoleDraft $roleDraft
495
     */
496
    public function deleteRoleDraft(APIRoleDraft $roleDraft)
497
    {
498
        $loadedRoleDraft = $this->loadRoleDraft($roleDraft->id);
499
500
        $this->repository->beginTransaction();
501
        try {
502
            $this->userHandler->deleteRole($loadedRoleDraft->id, Role::STATUS_DRAFT);
503
            $this->repository->commit();
504
        } catch (Exception $e) {
505
            $this->repository->rollback();
506
            throw $e;
507
        }
508
    }
509
510
    /**
511
     * Publishes a given RoleDraft.
@@ 704-714 (lines=11) @@
701
     *
702
     * @throws \Exception
703
     */
704
    protected function internalDeletePolicy(APIPolicy $policy)
705
    {
706
        $this->repository->beginTransaction();
707
        try {
708
            $this->userHandler->deletePolicy($policy->id, $policy->roleId);
709
            $this->repository->commit();
710
        } catch (Exception $e) {
711
            $this->repository->rollback();
712
            throw $e;
713
        }
714
    }
715
716
    /**
717
     * Updates the limitations of a policy. The module and function cannot be changed and