Code Duplication    Length = 6-6 lines in 2 locations

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

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

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

@@ 4654-4659 (lines=6) @@
4651
        foreach ($result->searchHits as $hit) {
4652
            switch (true) {
4653
                case $hit->valueObject instanceof Content:
4654
                case $hit->valueObject instanceof Location:
4655
                    $hit->valueObject = [
4656
                        'id' => $hit->valueObject->contentInfo->id,
4657
                        'title' => $hit->valueObject->contentInfo->name,
4658
                    ];
4659
                    break;
4660
4661
                case $hit->valueObject instanceof ContentInfo:
4662
                    $hit->valueObject = [