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

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