Total Complexity | 9 |
Total Lines | 110 |
Duplicated Lines | 0 % |
Coverage | 91.3% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | abstract class AbstractExpr implements ExprInterface |
||
13 | { |
||
14 | /** |
||
15 | * @var string|null |
||
16 | */ |
||
17 | protected $relation; |
||
18 | |||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $column; |
||
23 | |||
24 | /** |
||
25 | * @var mixed |
||
26 | */ |
||
27 | protected $value; |
||
28 | |||
29 | /** |
||
30 | * @var string |
||
31 | */ |
||
32 | protected $expression; |
||
33 | |||
34 | /** |
||
35 | * @var string |
||
36 | */ |
||
37 | protected $operator; |
||
38 | |||
39 | /** |
||
40 | * AbstractExpr constructor. |
||
41 | * |
||
42 | * @param string|null $relation |
||
43 | * @param string $column |
||
44 | * @param mixed $value |
||
45 | */ |
||
46 | 12 | public function __construct(?string $relation, string $column, $value) |
|
47 | { |
||
48 | 12 | $this->relation = $relation; |
|
49 | 12 | $this->column = $column; |
|
50 | 12 | $this->value = $value; |
|
51 | 12 | } |
|
52 | |||
53 | /** |
||
54 | * {@inheritdoc} |
||
55 | */ |
||
56 | public function getRelation(): ?string |
||
57 | { |
||
58 | return $this->relation; |
||
59 | } |
||
60 | |||
61 | /** |
||
62 | * {@inheritdoc} |
||
63 | */ |
||
64 | 12 | public function getColumn(): string |
|
65 | { |
||
66 | 12 | return $this->column; |
|
67 | } |
||
68 | |||
69 | /** |
||
70 | * {@inheritdoc} |
||
71 | */ |
||
72 | 12 | public function getValue() |
|
73 | { |
||
74 | 12 | return $this->value; |
|
75 | } |
||
76 | |||
77 | /** |
||
78 | * {@inheritdoc} |
||
79 | */ |
||
80 | 12 | public function setExpression(string $expression = null): self |
|
81 | { |
||
82 | 12 | $this->expression = $expression; |
|
83 | |||
84 | 12 | return $this; |
|
85 | } |
||
86 | |||
87 | /** |
||
88 | * {@inheritdoc} |
||
89 | */ |
||
90 | 12 | public function getExpression(): string |
|
91 | { |
||
92 | 12 | return $this->expression; |
|
93 | } |
||
94 | |||
95 | /** |
||
96 | * {@inheritdoc} |
||
97 | */ |
||
98 | 12 | public function setOperator(string $operator = null): self |
|
99 | { |
||
100 | 12 | $this->operator = $operator; |
|
101 | |||
102 | 12 | return $this; |
|
103 | } |
||
104 | |||
105 | /** |
||
106 | * {@inheritdoc} |
||
107 | */ |
||
108 | 7 | public function getOperator(): ?string |
|
109 | { |
||
110 | 7 | return $this->operator; |
|
111 | } |
||
112 | |||
113 | /** |
||
114 | * @param $delimiter |
||
115 | * @param $value |
||
116 | * |
||
117 | * @return array |
||
118 | */ |
||
119 | 5 | protected function valueToArray($delimiter, $value): array |
|
122 | } |
||
123 | } |
||
124 |