Total Complexity | 7 |
Total Lines | 92 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
13 | final class Condition extends AbstractNode implements ConditionInterface |
||
14 | { |
||
15 | /** |
||
16 | * Operator code |
||
17 | * |
||
18 | * @var string |
||
19 | */ |
||
20 | private $operator; |
||
21 | |||
22 | /** |
||
23 | * Key value identifier in the data source |
||
24 | * |
||
25 | * @var string |
||
26 | */ |
||
27 | private $valueIdentifier; |
||
28 | |||
29 | /** |
||
30 | * Value to compare to the data source value |
||
31 | * |
||
32 | * @var mixed |
||
33 | */ |
||
34 | private $valueCompare; |
||
35 | |||
36 | /** |
||
37 | * Condition constructor |
||
38 | * |
||
39 | * @param string $valueIdentifier |
||
40 | * @param string $operator |
||
41 | * @param mixed $valueCompare |
||
42 | */ |
||
43 | public function __construct( |
||
44 | string $valueIdentifier, |
||
45 | string $operator, |
||
46 | $valueCompare |
||
47 | ) { |
||
48 | $this->setValueIdentifier($valueIdentifier); |
||
49 | $this->setOperator($operator); |
||
50 | $this->setValueCompare($valueCompare); |
||
51 | } |
||
52 | |||
53 | /** |
||
54 | * {@inheritdoc} |
||
55 | */ |
||
56 | public function getOperator(): string |
||
59 | } |
||
60 | |||
61 | /** |
||
62 | * {@inheritdoc} |
||
63 | */ |
||
64 | public function setOperator(string $operator): ConditionInterface |
||
65 | { |
||
66 | $this->operator = $operator; |
||
67 | |||
68 | return $this; |
||
69 | } |
||
70 | |||
71 | /** |
||
72 | * {@inheritdoc} |
||
73 | */ |
||
74 | public function getValueIdentifier(): string |
||
77 | } |
||
78 | |||
79 | /** |
||
80 | * {@inheritdoc} |
||
81 | */ |
||
82 | public function setValueIdentifier(string $identifier): ConditionInterface |
||
83 | { |
||
84 | $this->valueIdentifier = $identifier; |
||
85 | |||
86 | return $this; |
||
87 | } |
||
88 | |||
89 | /** |
||
90 | * {@inheritdoc} |
||
91 | */ |
||
92 | public function getValueCompare() |
||
95 | } |
||
96 | |||
97 | /** |
||
98 | * {@inheritdoc} |
||
99 | */ |
||
100 | public function setValueCompare($value): ConditionInterface |
||
105 | } |
||
106 | } |
||
107 |