Code Duplication    Length = 18-18 lines in 6 locations

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

@@ 285-302 (lines=18) @@
282
     *
283
     * @param \eZ\Publish\API\Repository\Values\Content\Section $section
284
     */
285
    public function deleteSection(Section $section)
286
    {
287
        $response = $this->client->request(
288
            'DELETE',
289
            $section->id,
290
            new Message(
291
                // @todo: What media-type should we set here? Actually, it should be
292
                // all expected exceptions + none? Or is "Section" correct,
293
                // since this is what is to be expected by the resource
294
                // identified by the URL?
295
                array('Accept' => $this->outputVisitor->getMediaType('Section'))
296
            )
297
        );
298
299
        if (!empty($response->body)) {
300
            $this->inputDispatcher->parse($response);
301
        }
302
    }
303
304
    /**
305
     * Instantiates a new SectionCreateStruct.

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

@@ 581-598 (lines=18) @@
578
     *
579
     * @param \eZ\Publish\API\Repository\Values\User\Role $role
580
     */
581
    public function deleteRole(APIRole $role)
582
    {
583
        $response = $this->client->request(
584
            'DELETE',
585
            $role->id,
586
            new Message(
587
                // @todo: What media-type should we set here? Actually, it should be
588
                // all expected exceptions + none? Or is "Section" correct,
589
                // since this is what is to be expected by the resource
590
                // identified by the URL?
591
                array('Accept' => $this->outputVisitor->getMediaType('Role'))
592
            )
593
        );
594
595
        if (!empty($response->body)) {
596
            $this->inputDispatcher->parse($response);
597
        }
598
    }
599
600
    /**
601
     * Loads all policies from roles which are assigned to a user or to user groups to which the user belongs.

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

@@ 188-205 (lines=18) @@
185
     *
186
     * @param \eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup $objectStateGroup
187
     */
188
    public function deleteObjectStateGroup(ObjectStateGroup $objectStateGroup)
189
    {
190
        $response = $this->client->request(
191
            'DELETE',
192
            $objectStateGroup->id,
193
            new Message(
194
                // @todo: What media-type should we set here? Actually, it should be
195
                // all expected exceptions + none? Or is "ObjectStateGroup" correct,
196
                // since this is what is to be expected by the resource
197
                // identified by the URL?
198
                array('Accept' => $this->outputVisitor->getMediaType('ObjectStateGroup'))
199
            )
200
        );
201
202
        if (!empty($response->body)) {
203
            $this->inputDispatcher->parse($response);
204
        }
205
    }
206
207
    /**
208
     * Creates a new object state in the given group.
@@ 300-317 (lines=18) @@
297
     *
298
     * @param \eZ\Publish\API\Repository\Values\ObjectState\ObjectState $objectState
299
     */
300
    public function deleteObjectState(ObjectState $objectState)
301
    {
302
        $response = $this->client->request(
303
            'DELETE',
304
            $objectState->id,
305
            new Message(
306
                // @todo: What media-type should we set here? Actually, it should be
307
                // all expected exceptions + none? Or is "ObjectState" correct,
308
                // since this is what is to be expected by the resource
309
                // identified by the URL?
310
                array('Accept' => $this->outputVisitor->getMediaType('ObjectState'))
311
            )
312
        );
313
314
        if (!empty($response->body)) {
315
            $this->inputDispatcher->parse($response);
316
        }
317
    }
318
319
    /**
320
     * Sets the object-state of a state group to $state for the given content.

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

@@ 153-170 (lines=18) @@
150
     *
151
     * @throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException if the user is not allowed to empty the trash
152
     */
153
    public function emptyTrash()
154
    {
155
        $response = $this->client->request(
156
            'DELETE',
157
            $this->requestParser->generate('trashItems'),
158
            new Message(
159
                // @todo: What media-type should we set here? Actually, it should be
160
                // all expected exceptions + none? Or is "Location" correct,
161
                // since this is what is to be expected by the resource
162
                // identified by the URL?
163
                array('Accept' => $this->outputVisitor->getMediaType('Location'))
164
            )
165
        );
166
167
        if (!empty($response->body)) {
168
            $this->inputDispatcher->parse($response);
169
        }
170
    }
171
172
    /**
173
     * Deletes a trash item.
@@ 181-198 (lines=18) @@
178
     *
179
     * @param \eZ\Publish\API\Repository\Values\Content\TrashItem $trashItem
180
     */
181
    public function deleteTrashItem(APITrashItem $trashItem)
182
    {
183
        $response = $this->client->request(
184
            'DELETE',
185
            $trashItem->id,
186
            new Message(
187
                // @todo: What media-type should we set here? Actually, it should be
188
                // all expected exceptions + none? Or is "Location" correct,
189
                // since this is what is to be expected by the resource
190
                // identified by the URL?
191
                array('Accept' => $this->outputVisitor->getMediaType('Location'))
192
            )
193
        );
194
195
        if (!empty($response->body)) {
196
            $this->inputDispatcher->parse($response);
197
        }
198
    }
199
200
    /**
201
     * Returns a collection of Trashed locations contained in the trash, which are readable by the current user.