Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
50 | public function method(string $method): self |
||
51 | { |
||
52 | if (!\in_array($method, $available = ['termsFilter', 'booleanQuery', 'automaton', 'docValuesTermsFilter'], true)) { |
||
53 | throw new \InvalidArgumentException(sprintf('Available methods: %s!', implode(',', $available))); |
||
54 | } |
||
55 | |||
56 | $terms = clone $this; |
||
57 | $terms->params['method'] = $method; |
||
58 | |||
59 | return $terms; |
||
60 | } |
||
62 |