Total Complexity | 14 |
Total Lines | 158 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php declare(strict_types=1); |
||
12 | class Filter |
||
13 | { |
||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | private $field; |
||
18 | |||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | private $type; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | private $connector = 'and'; |
||
28 | |||
29 | /** |
||
30 | * @var bool |
||
31 | */ |
||
32 | private $having = false; |
||
33 | |||
34 | private $x; |
||
35 | private $y; |
||
36 | |||
37 | private $extra; |
||
38 | |||
39 | /** |
||
40 | * @return string |
||
41 | */ |
||
42 | 27 | public function getField(): string |
|
43 | { |
||
44 | 27 | return $this->field; |
|
45 | } |
||
46 | |||
47 | /** |
||
48 | * @param string $field |
||
49 | * @return Filter |
||
50 | */ |
||
51 | 21 | public function setField(string $field): Filter |
|
52 | { |
||
53 | 21 | $this->field = $field; |
|
54 | |||
55 | 21 | return $this; |
|
56 | } |
||
57 | |||
58 | /** |
||
59 | * @return string |
||
60 | */ |
||
61 | 6 | public function getType(): string |
|
62 | { |
||
63 | 6 | return $this->type; |
|
64 | } |
||
65 | |||
66 | /** |
||
67 | * @param string $type |
||
68 | * @return Filter |
||
69 | */ |
||
70 | 3 | public function setType(string $type): Filter |
|
71 | { |
||
72 | 3 | $this->type = $type; |
|
73 | |||
74 | 3 | return $this; |
|
75 | } |
||
76 | |||
77 | /** |
||
78 | * @return string |
||
79 | */ |
||
80 | 6 | public function getConnector(): string |
|
83 | } |
||
84 | |||
85 | /** |
||
86 | * @param string $connector |
||
87 | * @return Filter |
||
88 | */ |
||
89 | 3 | public function setConnector(string $connector): Filter |
|
90 | { |
||
91 | 3 | $this->connector = $connector; |
|
92 | |||
93 | 3 | return $this; |
|
94 | } |
||
95 | |||
96 | /** |
||
97 | * @return bool |
||
98 | */ |
||
99 | 6 | public function isHaving(): bool |
|
100 | { |
||
101 | 6 | return $this->having; |
|
102 | } |
||
103 | |||
104 | /** |
||
105 | * @param bool $having |
||
106 | * @return Filter |
||
107 | */ |
||
108 | 3 | public function setHaving(bool $having): Filter |
|
109 | { |
||
110 | 3 | $this->having = $having; |
|
111 | |||
112 | 3 | return $this; |
|
113 | } |
||
114 | |||
115 | /** |
||
116 | * @return mixed |
||
117 | */ |
||
118 | 22 | public function getX() |
|
121 | } |
||
122 | |||
123 | /** |
||
124 | * @param mixed $x |
||
125 | * @return Filter |
||
126 | */ |
||
127 | 19 | public function setX($x): Filter |
|
128 | { |
||
129 | 19 | $this->x = $x; |
|
130 | |||
131 | 19 | return $this; |
|
132 | } |
||
133 | |||
134 | /** |
||
135 | * @return mixed |
||
136 | */ |
||
137 | 2 | public function getY() |
|
138 | { |
||
139 | 2 | return $this->y; |
|
140 | } |
||
141 | |||
142 | /** |
||
143 | * @param mixed $y |
||
144 | * @return Filter |
||
145 | */ |
||
146 | 5 | public function setY($y): Filter |
|
151 | } |
||
152 | |||
153 | /** |
||
154 | * @return mixed |
||
155 | */ |
||
156 | 8 | public function getExtra() |
|
157 | { |
||
158 | 8 | return $this->extra; |
|
159 | } |
||
160 | |||
161 | /** |
||
162 | * @param mixed $extra |
||
163 | * @return Filter |
||
164 | */ |
||
165 | 5 | public function setExtra($extra): Filter |
|
170 | } |
||
171 | } |