Total Complexity | 4 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
11 | class FilterEntry extends AFilterEntry |
||
12 | { |
||
13 | protected static $relations = [ |
||
14 | self::RELATION_EQUAL, |
||
15 | self::RELATION_NOT_EQUAL, |
||
16 | self::RELATION_LESS, |
||
17 | self::RELATION_LESS_EQ, |
||
18 | self::RELATION_MORE, |
||
19 | self::RELATION_MORE_EQ, |
||
20 | self::RELATION_EMPTY, |
||
21 | self::RELATION_NOT_EMPTY, |
||
22 | ]; |
||
23 | |||
24 | /** @var string */ |
||
25 | protected $value = ''; |
||
26 | |||
27 | 10 | public function setValue($value): Interfaces\IFilterEntry |
|
28 | { |
||
29 | 10 | $this->value = $this->toString($value); |
|
30 | 10 | return $this; |
|
31 | } |
||
32 | |||
33 | /** |
||
34 | * @param string|string[]|Interfaces\IFilterEntry $value |
||
35 | * @return string |
||
36 | */ |
||
37 | 10 | protected function toString($value): string |
|
38 | { |
||
39 | 10 | if (is_array($value)) { |
|
40 | 2 | return strval(reset($value)); |
|
41 | } else { |
||
42 | 8 | return strval($value); |
|
43 | } |
||
44 | } |
||
45 | |||
46 | 7 | public function getValue() |
|
49 | } |
||
50 | } |
||
51 |