Code Duplication    Length = 18-18 lines in 2 locations

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

@@ 233-250 (lines=18) @@
230
     *
231
     * @return \eZ\Publish\API\Repository\Values\Content\TrashItem
232
     */
233
    protected function buildTrashItem(Location $location)
234
    {
235
        return new TrashItem(
236
            array(
237
                'contentInfo' => $location->contentInfo,
238
                'id' => $location->id,
239
                'priority' => $location->priority,
240
                'hidden' => $location->hidden,
241
                'invisible' => $location->invisible,
242
                'remoteId' => $location->remoteId,
243
                'parentLocationId' => $location->parentLocationId,
244
                'pathString' => $location->pathString,
245
                'depth' => (int)$location->depth,
246
                'sortField' => $location->sortField,
247
                'sortOrder' => $location->sortOrder,
248
            )
249
        );
250
    }
251
}
252

eZ/Publish/Core/Repository/TrashService.php 1 location

@@ 320-337 (lines=18) @@
317
     *
318
     * @return \eZ\Publish\API\Repository\Values\Content\TrashItem
319
     */
320
    protected function buildDomainTrashItemObject(Trashed $spiTrashItem)
321
    {
322
        return new TrashItem(
323
            array(
324
                'contentInfo' => $this->repository->getContentService()->loadContentInfo($spiTrashItem->contentId),
325
                'id' => $spiTrashItem->id,
326
                'priority' => $spiTrashItem->priority,
327
                'hidden' => $spiTrashItem->hidden,
328
                'invisible' => $spiTrashItem->invisible,
329
                'remoteId' => $spiTrashItem->remoteId,
330
                'parentLocationId' => $spiTrashItem->parentId,
331
                'pathString' => $spiTrashItem->pathString,
332
                'depth' => $spiTrashItem->depth,
333
                'sortField' => $spiTrashItem->sortField,
334
                'sortOrder' => $spiTrashItem->sortOrder,
335
            )
336
        );
337
    }
338
339
    /**
340
     * @param int $timestamp