| Total Complexity | 14 |
| Total Lines | 158 |
| Duplicated Lines | 0 % |
| Coverage | 82.86% |
| Changes | 0 | ||
| 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 | 21 | public function getField(): string |
|
| 43 | { |
||
| 44 | 21 | return $this->field; |
|
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @param string $field |
||
| 49 | * @return Filter |
||
| 50 | */ |
||
| 51 | 20 | public function setField(string $field): Filter |
|
| 52 | { |
||
| 53 | 20 | $this->field = $field; |
|
| 54 | |||
| 55 | 20 | return $this; |
|
| 56 | } |
||
| 57 | |||
| 58 | /** |
||
| 59 | * @return string |
||
| 60 | */ |
||
| 61 | 3 | public function getType(): string |
|
| 62 | { |
||
| 63 | 3 | return $this->type; |
|
| 64 | } |
||
| 65 | |||
| 66 | /** |
||
| 67 | * @param string $type |
||
| 68 | * @return Filter |
||
| 69 | */ |
||
| 70 | 2 | public function setType(string $type): Filter |
|
| 71 | { |
||
| 72 | 2 | $this->type = $type; |
|
| 73 | |||
| 74 | 2 | return $this; |
|
| 75 | } |
||
| 76 | |||
| 77 | /** |
||
| 78 | * @return string |
||
| 79 | */ |
||
| 80 | 3 | public function getConnector(): string |
|
| 83 | } |
||
| 84 | |||
| 85 | /** |
||
| 86 | * @param string $connector |
||
| 87 | * @return Filter |
||
| 88 | */ |
||
| 89 | public function setConnector(string $connector): Filter |
||
| 90 | { |
||
| 91 | $this->connector = $connector; |
||
| 92 | |||
| 93 | return $this; |
||
| 94 | } |
||
| 95 | |||
| 96 | /** |
||
| 97 | * @return bool |
||
| 98 | */ |
||
| 99 | 3 | public function isHaving(): bool |
|
| 100 | { |
||
| 101 | 3 | return $this->having; |
|
| 102 | } |
||
| 103 | |||
| 104 | /** |
||
| 105 | * @param bool $having |
||
| 106 | * @return Filter |
||
| 107 | */ |
||
| 108 | public function setHaving(bool $having): Filter |
||
| 109 | { |
||
| 110 | $this->having = $having; |
||
| 111 | |||
| 112 | return $this; |
||
| 113 | } |
||
| 114 | |||
| 115 | /** |
||
| 116 | * @return mixed |
||
| 117 | */ |
||
| 118 | 19 | public function getX() |
|
| 121 | } |
||
| 122 | |||
| 123 | /** |
||
| 124 | * @param mixed $x |
||
| 125 | * @return Filter |
||
| 126 | */ |
||
| 127 | 18 | public function setX($x): Filter |
|
| 128 | { |
||
| 129 | 18 | $this->x = $x; |
|
| 130 | |||
| 131 | 18 | 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 | 2 | public function setY($y): Filter |
|
| 151 | } |
||
| 152 | |||
| 153 | /** |
||
| 154 | * @return mixed |
||
| 155 | */ |
||
| 156 | 6 | public function getExtra() |
|
| 157 | { |
||
| 158 | 6 | return $this->extra; |
|
| 159 | } |
||
| 160 | |||
| 161 | /** |
||
| 162 | * @param mixed $extra |
||
| 163 | * @return Filter |
||
| 164 | */ |
||
| 165 | 4 | public function setExtra($extra): Filter |
|
| 170 | } |
||
| 171 | } |