Code Duplication    Length = 18-18 lines in 2 locations

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

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

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

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