Code Duplication    Length = 6-6 lines in 2 locations

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

@@ 1144-1149 (lines=6) @@
1141
1142
        foreach ($result->searchHits as $hit) {
1143
            switch (true) {
1144
                case $hit->valueObject instanceof Location:
1145
                    $hit->valueObject = array(
1146
                        'id' => $hit->valueObject->contentInfo->id,
1147
                        'title' => $hit->valueObject->contentInfo->name,
1148
                    );
1149
                    break;
1150
1151
                default:
1152
                    throw new \RuntimeException('Unknown search result hit type: ' . get_class($hit->valueObject));

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

@@ 4450-4455 (lines=6) @@
4447
        foreach ($result->searchHits as $hit) {
4448
            switch (true) {
4449
                case $hit->valueObject instanceof Content:
4450
                case $hit->valueObject instanceof Location:
4451
                    $hit->valueObject = array(
4452
                        'id' => $hit->valueObject->contentInfo->id,
4453
                        'title' => $hit->valueObject->contentInfo->name,
4454
                    );
4455
                    break;
4456
4457
                case $hit->valueObject instanceof ContentInfo:
4458
                    $hit->valueObject = array(