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

@@ 4623-4628 (lines=6) @@
4620
        foreach ($result->searchHits as $hit) {
4621
            switch (true) {
4622
                case $hit->valueObject instanceof Content:
4623
                case $hit->valueObject instanceof Location:
4624
                    $hit->valueObject = array(
4625
                        'id' => $hit->valueObject->contentInfo->id,
4626
                        'title' => $hit->valueObject->contentInfo->name,
4627
                    );
4628
                    break;
4629
4630
                case $hit->valueObject instanceof ContentInfo:
4631
                    $hit->valueObject = array(