Code Duplication    Length = 10-10 lines in 3 locations

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

@@ 261-270 (lines=10) @@
258
     *
259
     * @return \eZ\Publish\API\Repository\Values\User\RoleDraft
260
     */
261
    public function loadRoleDraft($id)
262
    {
263
        if ($this->repository->hasAccess('role', 'read') !== true) {
264
            throw new UnauthorizedException('role', 'read');
265
        }
266
267
        $spiRole = $this->userHandler->loadRole($id, Role::STATUS_DRAFT);
268
269
        return $this->roleDomainMapper->buildDomainRoleDraftObject($spiRole);
270
    }
271
272
    /**
273
     * Loads a RoleDraft by the ID of the role it was created from.
@@ 282-291 (lines=10) @@
279
     *
280
     * @return \eZ\Publish\API\Repository\Values\User\RoleDraft
281
     */
282
    public function loadRoleDraftByRoleId($roleId)
283
    {
284
        if ($this->repository->hasAccess('role', 'read') !== true) {
285
            throw new UnauthorizedException('role', 'read');
286
        }
287
288
        $spiRole = $this->userHandler->loadRoleDraftByRoleId($roleId);
289
290
        return $this->roleDomainMapper->buildDomainRoleDraftObject($spiRole);
291
    }
292
293
    /**
294
     * Updates the properties of a RoleDraft.
@@ 839-848 (lines=10) @@
836
     *
837
     * @return \eZ\Publish\API\Repository\Values\User\Role
838
     */
839
    public function loadRole($id)
840
    {
841
        if ($this->repository->hasAccess('role', 'read') !== true) {
842
            throw new UnauthorizedException('role', 'read');
843
        }
844
845
        $spiRole = $this->userHandler->loadRole($id);
846
847
        return $this->roleDomainMapper->buildDomainRoleObject($spiRole);
848
    }
849
850
    /**
851
     * Loads a role for the given identifier.