Code Duplication    Length = 11-13 lines in 2 locations

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

@@ 468-480 (lines=13) @@
465
     *
466
     * @param \eZ\Publish\API\Repository\Values\User\RoleDraft $roleDraft
467
     */
468
    public function deleteRoleDraft(APIRoleDraft $roleDraft)
469
    {
470
        $loadedRoleDraft = $this->loadRoleDraft($roleDraft->id);
471
472
        $this->repository->beginTransaction();
473
        try {
474
            $this->userHandler->deleteRole($loadedRoleDraft->id, Role::STATUS_DRAFT);
475
            $this->repository->commit();
476
        } catch (Exception $e) {
477
            $this->repository->rollback();
478
            throw $e;
479
        }
480
    }
481
482
    /**
483
     * Publishes a given RoleDraft.
@@ 676-686 (lines=11) @@
673
     *
674
     * @throws \Exception
675
     */
676
    protected function internalDeletePolicy(APIPolicy $policy)
677
    {
678
        $this->repository->beginTransaction();
679
        try {
680
            $this->userHandler->deletePolicy($policy->id, $policy->roleId);
681
            $this->repository->commit();
682
        } catch (Exception $e) {
683
            $this->repository->rollback();
684
            throw $e;
685
        }
686
    }
687
688
    /**
689
     * Updates the limitations of a policy. The module and function cannot be changed and