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

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