Code Duplication    Length = 18-18 lines in 2 locations

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

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

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

@@ 240-257 (lines=18) @@
237
     *
238
     * @return \eZ\Publish\API\Repository\Values\Content\TrashItem
239
     */
240
    protected function buildTrashItem(Location $location)
241
    {
242
        return new TrashItem(
243
            array(
244
                'contentInfo' => $location->contentInfo,
245
                'id' => $location->id,
246
                'priority' => $location->priority,
247
                'hidden' => $location->hidden,
248
                'invisible' => $location->invisible,
249
                'remoteId' => $location->remoteId,
250
                'parentLocationId' => $location->parentLocationId,
251
                'pathString' => $location->pathString,
252
                'depth' => (int)$location->depth,
253
                'sortField' => $location->sortField,
254
                'sortOrder' => $location->sortOrder,
255
            )
256
        );
257
    }
258
259
    /**
260
     * Checks if Content is in trash when we can't rely only on locationId (ie. because ContentId is all we have,