Code Duplication    Length = 6-6 lines in 2 locations

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

@@ 1127-1132 (lines=6) @@
1124
1125
        foreach ($result->searchHits as $hit) {
1126
            switch (true) {
1127
                case $hit->valueObject instanceof Location:
1128
                    $hit->valueObject = array(
1129
                        'id' => $hit->valueObject->contentInfo->id,
1130
                        'title' => $hit->valueObject->contentInfo->name,
1131
                    );
1132
                    break;
1133
1134
                default:
1135
                    throw new \RuntimeException('Unknown search result hit type: ' . get_class($hit->valueObject));

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

@@ 4561-4566 (lines=6) @@
4558
        foreach ($result->searchHits as $hit) {
4559
            switch (true) {
4560
                case $hit->valueObject instanceof Content:
4561
                case $hit->valueObject instanceof Location:
4562
                    $hit->valueObject = array(
4563
                        'id' => $hit->valueObject->contentInfo->id,
4564
                        'title' => $hit->valueObject->contentInfo->name,
4565
                    );
4566
                    break;
4567
4568
                case $hit->valueObject instanceof ContentInfo:
4569
                    $hit->valueObject = array(