Code Duplication    Length = 6-6 lines in 2 locations

eZ/Publish/API/Repository/Tests/SearchServiceTest.php 1 location

@@ 4585-4590 (lines=6) @@
4582
        foreach ($result->searchHits as $hit) {
4583
            switch (true) {
4584
                case $hit->valueObject instanceof Content:
4585
                case $hit->valueObject instanceof Location:
4586
                    $hit->valueObject = [
4587
                        'id' => $hit->valueObject->contentInfo->id,
4588
                        'title' => $hit->valueObject->contentInfo->name,
4589
                    ];
4590
                    break;
4591
4592
                case $hit->valueObject instanceof ContentInfo:
4593
                    $hit->valueObject = [

eZ/Publish/API/Repository/Tests/SearchServiceLocationTest.php 1 location

@@ 1380-1385 (lines=6) @@
1377
1378
        foreach ($result->searchHits as $hit) {
1379
            switch (true) {
1380
                case $hit->valueObject instanceof Location:
1381
                    $hit->valueObject = [
1382
                        'id' => $hit->valueObject->contentInfo->id,
1383
                        'title' => $hit->valueObject->contentInfo->name,
1384
                    ];
1385
                    break;
1386
1387
                default:
1388
                    throw new \RuntimeException('Unknown search result hit type: ' . get_class($hit->valueObject));