| Conditions | 5 |
| Paths | 16 |
| Total Lines | 21 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 78 | 2 | public function compile(): array |
|
| 79 | { |
||
| 80 | 2 | $query = []; |
|
| 81 | |||
| 82 | 2 | if ($this->positiveQuery) { |
|
| 83 | 1 | $query['positive'] = \elastics_compile($this->positiveQuery); |
|
| 84 | } |
||
| 85 | |||
| 86 | 2 | if ($this->positiveBoost !== null) { |
|
| 87 | 1 | $query['boost'] = $this->positiveBoost; |
|
| 88 | } |
||
| 89 | |||
| 90 | 2 | if ($this->negativeQuery) { |
|
| 91 | 1 | $query['negative'] = \elastics_compile($this->negativeQuery); |
|
| 92 | } |
||
| 93 | |||
| 94 | 2 | if ($this->negativeBoost !== null) { |
|
| 95 | 1 | $query['negative_boost'] = $this->negativeBoost; |
|
| 96 | } |
||
| 97 | |||
| 98 | 2 | return $query; |
|
| 99 | } |
||
| 101 |