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

@@ 4689-4694 (lines=6) @@
4686
        foreach ($result->searchHits as $hit) {
4687
            switch (true) {
4688
                case $hit->valueObject instanceof Content:
4689
                case $hit->valueObject instanceof Location:
4690
                    $hit->valueObject = array(
4691
                        'id' => $hit->valueObject->contentInfo->id,
4692
                        'title' => $hit->valueObject->contentInfo->name,
4693
                    );
4694
                    break;
4695
4696
                case $hit->valueObject instanceof ContentInfo:
4697
                    $hit->valueObject = array(