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

@@ 4636-4641 (lines=6) @@
4633
        foreach ($result->searchHits as $hit) {
4634
            switch (true) {
4635
                case $hit->valueObject instanceof Content:
4636
                case $hit->valueObject instanceof Location:
4637
                    $hit->valueObject = array(
4638
                        'id' => $hit->valueObject->contentInfo->id,
4639
                        'title' => $hit->valueObject->contentInfo->name,
4640
                    );
4641
                    break;
4642
4643
                case $hit->valueObject instanceof ContentInfo:
4644
                    $hit->valueObject = array(