Total Complexity | 6 |
Total Lines | 82 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
18 | class Boolean implements Query |
||
19 | { |
||
20 | use Traits\Boost; |
||
21 | |||
22 | /** |
||
23 | * @var array |
||
24 | */ |
||
25 | private $must = []; |
||
26 | |||
27 | /** |
||
28 | * @var array |
||
29 | */ |
||
30 | private $mustNot = []; |
||
31 | |||
32 | /** |
||
33 | * @var array |
||
34 | */ |
||
35 | private $should = []; |
||
36 | |||
37 | /** |
||
38 | * @var array |
||
39 | */ |
||
40 | private $filter = []; |
||
41 | |||
42 | /** |
||
43 | * {@inheritdoc} |
||
44 | */ |
||
45 | 1 | public function must(Query ...$queries): self |
|
46 | { |
||
47 | 1 | $this->must = \array_merge($this->must, $queries); |
|
48 | |||
49 | 1 | return $this; |
|
50 | } |
||
51 | |||
52 | /** |
||
53 | * {@inheritdoc} |
||
54 | */ |
||
55 | 1 | public function mustNot(Query ...$queries): self |
|
60 | } |
||
61 | |||
62 | /** |
||
63 | * {@inheritdoc} |
||
64 | */ |
||
65 | 1 | public function should(Query ...$queries): self |
|
66 | { |
||
67 | 1 | $this->should = \array_merge($this->should, $queries); |
|
68 | |||
69 | 1 | return $this; |
|
70 | } |
||
71 | |||
72 | /** |
||
73 | * {@inheritdoc} |
||
74 | */ |
||
75 | 1 | public function filter(Query ...$queries): self |
|
76 | { |
||
77 | 1 | $this->filter = \array_merge($this->filter, $queries); |
|
78 | |||
79 | 1 | return $this; |
|
80 | } |
||
81 | |||
82 | /** |
||
83 | * {@inheritdoc} |
||
84 | */ |
||
85 | 1 | public function name(): string |
|
86 | { |
||
87 | 1 | return 'bool'; |
|
88 | } |
||
89 | |||
90 | /** |
||
91 | * @return array |
||
92 | */ |
||
93 | 4 | public function compile(): array |
|
100 | ]); |
||
101 | } |
||
102 | } |
||
103 |