Code Duplication    Length = 10-10 lines in 3 locations

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

@@ 234-243 (lines=10) @@
231
     *
232
     * @return \eZ\Publish\API\Repository\Values\User\RoleDraft
233
     */
234
    public function loadRoleDraft($id)
235
    {
236
        if ($this->repository->hasAccess('role', 'read') !== true) {
237
            throw new UnauthorizedException('role', 'read');
238
        }
239
240
        $spiRole = $this->userHandler->loadRole($id, Role::STATUS_DRAFT);
241
242
        return $this->roleDomainMapper->buildDomainRoleDraftObject($spiRole);
243
    }
244
245
    /**
246
     * Loads a RoleDraft by the ID of the role it was created from.
@@ 255-264 (lines=10) @@
252
     *
253
     * @return \eZ\Publish\API\Repository\Values\User\RoleDraft
254
     */
255
    public function loadRoleDraftByRoleId($roleId)
256
    {
257
        if ($this->repository->hasAccess('role', 'read') !== true) {
258
            throw new UnauthorizedException('role', 'read');
259
        }
260
261
        $spiRole = $this->userHandler->loadRoleDraftByRoleId($roleId);
262
263
        return $this->roleDomainMapper->buildDomainRoleDraftObject($spiRole);
264
    }
265
266
    /**
267
     * Updates the properties of a RoleDraft.
@@ 784-793 (lines=10) @@
781
     *
782
     * @return \eZ\Publish\API\Repository\Values\User\Role
783
     */
784
    public function loadRole($id)
785
    {
786
        if ($this->repository->hasAccess('role', 'read') !== true) {
787
            throw new UnauthorizedException('role', 'read');
788
        }
789
790
        $spiRole = $this->userHandler->loadRole($id);
791
792
        return $this->roleDomainMapper->buildDomainRoleObject($spiRole);
793
    }
794
795
    /**
796
     * Loads a role for the given identifier.