Code Duplication    Length = 10-10 lines in 3 locations

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

@@ 206-215 (lines=10) @@
203
     *
204
     * @return \eZ\Publish\API\Repository\Values\User\RoleDraft
205
     */
206
    public function loadRoleDraft($id)
207
    {
208
        if ($this->repository->hasAccess('role', 'read') !== true) {
209
            throw new UnauthorizedException('role', 'read');
210
        }
211
212
        $spiRole = $this->userHandler->loadRole($id, Role::STATUS_DRAFT);
213
214
        return $this->roleDomainMapper->buildDomainRoleDraftObject($spiRole);
215
    }
216
217
    /**
218
     * Loads a RoleDraft by the ID of the role it was created from.
@@ 227-236 (lines=10) @@
224
     *
225
     * @return \eZ\Publish\API\Repository\Values\User\RoleDraft
226
     */
227
    public function loadRoleDraftByRoleId($roleId)
228
    {
229
        if ($this->repository->hasAccess('role', 'read') !== true) {
230
            throw new UnauthorizedException('role', 'read');
231
        }
232
233
        $spiRole = $this->userHandler->loadRoleDraftByRoleId($roleId);
234
235
        return $this->roleDomainMapper->buildDomainRoleDraftObject($spiRole);
236
    }
237
238
    /**
239
     * Updates the properties of a RoleDraft.
@@ 756-765 (lines=10) @@
753
     *
754
     * @return \eZ\Publish\API\Repository\Values\User\Role
755
     */
756
    public function loadRole($id)
757
    {
758
        if ($this->repository->hasAccess('role', 'read') !== true) {
759
            throw new UnauthorizedException('role', 'read');
760
        }
761
762
        $spiRole = $this->userHandler->loadRole($id);
763
764
        return $this->roleDomainMapper->buildDomainRoleObject($spiRole);
765
    }
766
767
    /**
768
     * Loads a role for the given identifier.