Code Duplication    Length = 12-12 lines in 13 locations

eZ/Publish/Core/REST/Client/ObjectStateService.php 3 locations

@@ 123-134 (lines=12) @@
120
    /**
121
     * {@inheritdoc}
122
     */
123
    public function loadObjectStateGroups($offset = 0, $limit = -1, array $prioritizedLanguages = [])
124
    {
125
        $response = $this->client->request(
126
            'GET',
127
            $this->requestParser->generate('objectstategroups'),
128
            new Message(
129
                array('Accept' => $this->outputVisitor->getMediaType('ObjectStateGroupList'))
130
            )
131
        );
132
133
        return $this->inputDispatcher->parse($response);
134
    }
135
136
    /**
137
     * {@inheritdoc}
@@ 107-118 (lines=12) @@
104
    /**
105
     * {@inheritdoc}
106
     */
107
    public function loadObjectStateGroup($objectStateGroupId, array $prioritizedLanguages = [])
108
    {
109
        $response = $this->client->request(
110
            'GET',
111
            $objectStateGroupId,
112
            new Message(
113
                array('Accept' => $this->outputVisitor->getMediaType('ObjectStateGroup'))
114
            )
115
        );
116
117
        return $this->inputDispatcher->parse($response);
118
    }
119
120
    /**
121
     * {@inheritdoc}
@@ 238-249 (lines=12) @@
235
    /**
236
     * {@inheritdoc}
237
     */
238
    public function loadObjectState($stateId, array $prioritizedLanguages = [])
239
    {
240
        $response = $this->client->request(
241
            'GET',
242
            $stateId,
243
            new Message(
244
                array('Accept' => $this->outputVisitor->getMediaType('ObjectState'))
245
            )
246
        );
247
248
        return $this->inputDispatcher->parse($response);
249
    }
250
251
    /**
252
     * Updates an object state.

eZ/Publish/Core/REST/Client/RoleService.php 1 location

@@ 561-572 (lines=12) @@
558
     *
559
     * @return \eZ\Publish\API\Repository\Values\User\Role[]
560
     */
561
    public function loadRoles()
562
    {
563
        $response = $this->client->request(
564
            'GET',
565
            $this->requestParser->generate('roles'),
566
            new Message(
567
                array('Accept' => $this->outputVisitor->getMediaType('RoleList'))
568
            )
569
        );
570
571
        return $this->inputDispatcher->parse($response);
572
    }
573
574
    /**
575
     * Deletes the given role.

eZ/Publish/Core/REST/Client/SectionService.php 2 locations

@@ 173-184 (lines=12) @@
170
     *
171
     * @return array of {@link \eZ\Publish\API\Repository\Values\Content\Section}
172
     */
173
    public function loadSections()
174
    {
175
        $response = $this->client->request(
176
            'GET',
177
            $this->requestParser->generate('sections'),
178
            new Message(
179
                array('Accept' => $this->outputVisitor->getMediaType('SectionList'))
180
            )
181
        );
182
183
        return $this->inputDispatcher->parse($response);
184
    }
185
186
    /**
187
     * Loads a Section from its identifier ($sectionIdentifier).
@@ 153-164 (lines=12) @@
150
     *
151
     * @return \eZ\Publish\API\Repository\Values\Content\Section
152
     */
153
    public function loadSection($sectionId)
154
    {
155
        $response = $this->client->request(
156
            'GET',
157
            $sectionId,
158
            new Message(
159
                array('Accept' => $this->outputVisitor->getMediaType('Section'))
160
            )
161
        );
162
163
        return $this->inputDispatcher->parse($response);
164
    }
165
166
    /**
167
     * Loads all sections.

eZ/Publish/Core/REST/Client/ContentTypeService.php 6 locations

@@ 121-132 (lines=12) @@
118
    /**
119
     * {@inheritdoc}
120
     */
121
    public function loadContentTypeGroup($contentTypeGroupId, array $prioritizedLanguages = [])
122
    {
123
        $response = $this->client->request(
124
            'GET',
125
            $contentTypeGroupId,
126
            new Message(
127
                array('Accept' => $this->outputVisitor->getMediaType('Section'))
128
            )
129
        );
130
131
        return $this->inputDispatcher->parse($response);
132
    }
133
134
    /**
135
     * {@inheritdoc}
@@ 375-386 (lines=12) @@
372
     *
373
     * @return \eZ\Publish\API\Repository\Values\ContentType\ContentTypeDraft
374
     */
375
    public function loadContentTypeDraft($contentTypeId)
376
    {
377
        $response = $this->client->request(
378
            'GET',
379
            $contentTypeId,
380
            new Message(
381
                array('Accept' => $this->outputVisitor->getMediaType('ContentType'))
382
            )
383
        );
384
385
        return $this->inputDispatcher->parse($response);
386
    }
387
388
    /**
389
     * Update a Content Type object.
@@ 474-485 (lines=12) @@
471
    /**
472
     * {@inheritdoc}
473
     */
474
    public function loadContentType($contentTypeId, array $prioritizedLanguages = [])
475
    {
476
        $response = $this->client->request(
477
            'GET',
478
            $contentTypeId,
479
            new Message(
480
                array('Accept' => $this->outputVisitor->getMediaType('ContentType'))
481
            )
482
        );
483
484
        return $this->completeContentType($this->inputDispatcher->parse($response));
485
    }
486
487
    /**
488
     * Loads a single field definition by $fieldDefinitionId.
@@ 497-508 (lines=12) @@
494
     *
495
     * @return FieldDefinition
496
     */
497
    public function loadFieldDefinition($fieldDefinitionId)
498
    {
499
        $response = $this->client->request(
500
            'GET',
501
            $fieldDefinitionId,
502
            new Message(
503
                array('Accept' => $this->outputVisitor->getMediaType('FieldDefinition'))
504
            )
505
        );
506
507
        return $this->inputDispatcher->parse($response);
508
    }
509
510
    /**
511
     * Loads the FieldDefinitionList stored at $fieldDefinitionListReference.
@@ 520-531 (lines=12) @@
517
     *
518
     * @return \eZ\Publish\Core\REST\Client\Values\FieldDefinitionList
519
     */
520
    public function loadFieldDefinitionList($fieldDefinitionListReference)
521
    {
522
        $response = $this->client->request(
523
            'GET',
524
            $fieldDefinitionListReference,
525
            new Message(
526
                array('Accept' => $this->outputVisitor->getMediaType('FieldDefinitionList'))
527
            )
528
        );
529
530
        return $this->inputDispatcher->parse($response);
531
    }
532
533
    /**
534
     * Loads the ContentTypeGroupList stored at $contentTypeGroupListReference.
@@ 543-554 (lines=12) @@
540
     *
541
     * @return \eZ\Publish\Core\REST\Client\Values\ContentTypeGroupRefList
542
     */
543
    public function loadContentTypeGroupList($contentTypeGroupListReference)
544
    {
545
        $response = $this->client->request(
546
            'GET',
547
            $contentTypeGroupListReference,
548
            new Message(
549
                array('Accept' => $this->outputVisitor->getMediaType('ContentTypeGroupRefList'))
550
            )
551
        );
552
553
        return $this->inputDispatcher->parse($response);
554
    }
555
556
    /**
557
     * {@inheritdoc}

eZ/Publish/Core/REST/Client/LocationService.php 1 location

@@ 140-151 (lines=12) @@
137
     *
138
     * @return \eZ\Publish\API\Repository\Values\Content\Location
139
     */
140
    public function loadLocation($locationId, array $prioritizedLanguages = null)
141
    {
142
        $response = $this->client->request(
143
            'GET',
144
            $locationId,
145
            new Message(
146
                array('Accept' => $this->outputVisitor->getMediaType('Location'))
147
            )
148
        );
149
150
        return $this->inputDispatcher->parse($response);
151
    }
152
153
    /**
154
     * Loads a location object from its $remoteId.