Code Duplication    Length = 6-6 lines in 2 locations

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

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

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