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

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