Code Duplication    Length = 6-6 lines in 2 locations

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

@@ 1240-1245 (lines=6) @@
1237
1238
        foreach ($result->searchHits as $hit) {
1239
            switch (true) {
1240
                case $hit->valueObject instanceof Location:
1241
                    $hit->valueObject = [
1242
                        'id' => $hit->valueObject->contentInfo->id,
1243
                        'title' => $hit->valueObject->contentInfo->name,
1244
                    ];
1245
                    break;
1246
1247
                default:
1248
                    throw new \RuntimeException('Unknown search result hit type: ' . get_class($hit->valueObject));

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 = [