Code Duplication    Length = 10-10 lines in 3 locations

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

@@ 235-244 (lines=10) @@
232
     *
233
     * @return \eZ\Publish\API\Repository\Values\User\RoleDraft
234
     */
235
    public function loadRoleDraft($id)
236
    {
237
        if ($this->repository->hasAccess('role', 'read') !== true) {
238
            throw new UnauthorizedException('role', 'read');
239
        }
240
241
        $spiRole = $this->userHandler->loadRole($id, Role::STATUS_DRAFT);
242
243
        return $this->roleDomainMapper->buildDomainRoleDraftObject($spiRole);
244
    }
245
246
    /**
247
     * Loads a RoleDraft by the ID of the role it was created from.
@@ 256-265 (lines=10) @@
253
     *
254
     * @return \eZ\Publish\API\Repository\Values\User\RoleDraft
255
     */
256
    public function loadRoleDraftByRoleId($roleId)
257
    {
258
        if ($this->repository->hasAccess('role', 'read') !== true) {
259
            throw new UnauthorizedException('role', 'read');
260
        }
261
262
        $spiRole = $this->userHandler->loadRoleDraftByRoleId($roleId);
263
264
        return $this->roleDomainMapper->buildDomainRoleDraftObject($spiRole);
265
    }
266
267
    /**
268
     * Updates the properties of a RoleDraft.
@@ 813-822 (lines=10) @@
810
     *
811
     * @return \eZ\Publish\API\Repository\Values\User\Role
812
     */
813
    public function loadRole($id)
814
    {
815
        if ($this->repository->hasAccess('role', 'read') !== true) {
816
            throw new UnauthorizedException('role', 'read');
817
        }
818
819
        $spiRole = $this->userHandler->loadRole($id);
820
821
        return $this->roleDomainMapper->buildDomainRoleObject($spiRole);
822
    }
823
824
    /**
825
     * Loads a role for the given identifier.