Code Duplication    Length = 6-6 lines in 2 locations

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

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

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

@@ 1459-1464 (lines=6) @@
1456
1457
        foreach ($result->searchHits as $hit) {
1458
            switch (true) {
1459
                case $hit->valueObject instanceof Location:
1460
                    $hit->valueObject = [
1461
                        'id' => $hit->valueObject->contentInfo->id,
1462
                        'title' => $hit->valueObject->contentInfo->name,
1463
                    ];
1464
                    break;
1465
1466
                default:
1467
                    throw new \RuntimeException('Unknown search result hit type: ' . get_class($hit->valueObject));