Code Duplication    Length = 6-6 lines in 2 locations

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));

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

@@ 4646-4651 (lines=6) @@
4643
        foreach ($result->searchHits as $hit) {
4644
            switch (true) {
4645
                case $hit->valueObject instanceof Content:
4646
                case $hit->valueObject instanceof Location:
4647
                    $hit->valueObject = [
4648
                        'id' => $hit->valueObject->contentInfo->id,
4649
                        'title' => $hit->valueObject->contentInfo->name,
4650
                    ];
4651
                    break;
4652
4653
                case $hit->valueObject instanceof ContentInfo:
4654
                    $hit->valueObject = [