Code Duplication    Length = 6-6 lines in 2 locations

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

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

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

@@ 4493-4498 (lines=6) @@
4490
        foreach ($result->searchHits as $hit) {
4491
            switch (true) {
4492
                case $hit->valueObject instanceof Content:
4493
                case $hit->valueObject instanceof Location:
4494
                    $hit->valueObject = array(
4495
                        'id' => $hit->valueObject->contentInfo->id,
4496
                        'title' => $hit->valueObject->contentInfo->name,
4497
                    );
4498
                    break;
4499
4500
                case $hit->valueObject instanceof ContentInfo:
4501
                    $hit->valueObject = array(