Completed
Branch master (0c9f05)
by
unknown
29:21
created

DummySearchIndexFieldDefinition::getMapping()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 14
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 9
nc 2
nop 1
dl 0
loc 14
rs 9.4285
c 1
b 0
f 0
1
<?php
2
3
/**
4
 * Dummy implementation of SearchIndexFieldDefinition for testing purposes.
5
 *
6
 * @since 1.28
7
 */
8
class DummySearchIndexFieldDefinition extends SearchIndexFieldDefinition {
9
10
	/**
11
	 * @param SearchEngine $engine
12
	 *
13
	 * @return array
14
	 */
15
	public function getMapping( SearchEngine $engine ) {
16
		$mapping = [
17
			'name' => $this->name,
18
			'type' => $this->type,
19
			'flags' => $this->flags,
20
			'subfields' => []
21
		];
22
23
		foreach ( $this->subfields as $subfield ) {
24
			$mapping['subfields'][] = $subfield->getMapping();
0 ignored issues
show
Bug introduced by
The call to getMapping() misses a required argument $engine.

This check looks for function calls that miss required arguments.

Loading history...
25
		}
26
27
		return $mapping;
28
	}
29
30
}
31