Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 10 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| DummySearchIndexFieldDefinition | |
0.00% |
0 / 9 |
|
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
| getMapping | |
0.00% |
0 / 9 |
|
0.00% |
0 / 1 |
6 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\Search; |
| 4 | |
| 5 | /** |
| 6 | * Dummy implementation of SearchIndexFieldDefinition for testing purposes. |
| 7 | * |
| 8 | * @since 1.28 |
| 9 | */ |
| 10 | class DummySearchIndexFieldDefinition extends SearchIndexFieldDefinition { |
| 11 | |
| 12 | /** |
| 13 | * @param SearchEngine $engine |
| 14 | * |
| 15 | * @return array |
| 16 | */ |
| 17 | public function getMapping( SearchEngine $engine ) { |
| 18 | $mapping = [ |
| 19 | 'name' => $this->name, |
| 20 | 'type' => $this->type, |
| 21 | 'flags' => $this->flags, |
| 22 | 'subfields' => [] |
| 23 | ]; |
| 24 | |
| 25 | foreach ( $this->subfields as $subfield ) { |
| 26 | $mapping['subfields'][] = $subfield->getMapping( $engine ); |
| 27 | } |
| 28 | |
| 29 | return $mapping; |
| 30 | } |
| 31 | |
| 32 | } |
| 33 | |
| 34 | /** @deprecated class alias since 1.46 */ |
| 35 | class_alias( DummySearchIndexFieldDefinition::class, 'DummySearchIndexFieldDefinition' ); |