Code Duplication    Length = 18-18 lines in 3 locations

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

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

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/API/Repository/Tests/LocationServiceTest.php 1 location

@@ 2404-2421 (lines=18) @@
2401
     *
2402
     * @return array
2403
     */
2404
    private function loadLocationProperties(Location $location, array $overwrite = array())
2405
    {
2406
        return array_merge(
2407
            array(
2408
                'id' => $location->id,
2409
                'depth' => $location->depth,
2410
                'parentLocationId' => $location->parentLocationId,
2411
                'pathString' => $location->pathString,
2412
                'remoteId' => $location->remoteId,
2413
                'hidden' => $location->hidden,
2414
                'invisible' => $location->invisible,
2415
                'priority' => $location->priority,
2416
                'sortField' => $location->sortField,
2417
                'sortOrder' => $location->sortOrder,
2418
            ),
2419
            $overwrite
2420
        );
2421
    }
2422
2423
    /**
2424
     * Assert generated aliases to expected alias return.