Conditions | 4 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
25 | public function toArray() |
||
26 | { |
||
27 | if ($this->field === null || $this->value === null) { |
||
28 | throw new InvalidArgument('"field" and "value" must be set for this type of query'); |
||
29 | } |
||
30 | |||
31 | $definition = [ |
||
32 | 'value' => $this->getValue(), |
||
33 | ]; |
||
34 | |||
35 | if ($this->hasBoost()) { |
||
36 | $definition['boost'] = $this->getBoost(); |
||
37 | } |
||
38 | |||
39 | return [ |
||
40 | 'wildcard' => [ |
||
41 | $this->getField() => $definition, |
||
42 | ], |
||
46 |