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

@@ 339-356 (lines=18) @@
336
     *
337
     * @return \eZ\Publish\API\Repository\Values\Content\TrashItem
338
     */
339
    protected function buildDomainTrashItemObject(Trashed $spiTrashItem)
340
    {
341
        return new TrashItem(
342
            array(
343
                'contentInfo' => $this->repository->getContentService()->loadContentInfo($spiTrashItem->contentId),
344
                'id' => $spiTrashItem->id,
345
                'priority' => $spiTrashItem->priority,
346
                'hidden' => $spiTrashItem->hidden,
347
                'invisible' => $spiTrashItem->invisible,
348
                'remoteId' => $spiTrashItem->remoteId,
349
                'parentLocationId' => $spiTrashItem->parentId,
350
                'pathString' => $spiTrashItem->pathString,
351
                'depth' => $spiTrashItem->depth,
352
                'sortField' => $spiTrashItem->sortField,
353
                'sortOrder' => $spiTrashItem->sortOrder,
354
            )
355
        );
356
    }
357
358
    /**
359
     * @param int $timestamp