1 | <?php |
||
22 | class QueryClauses |
||
23 | { |
||
24 | const QUERY_SELECT = 1; |
||
25 | const QUERY_UPDATE = 2; |
||
26 | |||
27 | /** |
||
28 | * @var array $selectClauses |
||
29 | */ |
||
30 | private $selectClauses = []; |
||
31 | |||
32 | /** |
||
33 | * @var array $whereClauses |
||
34 | */ |
||
35 | private $whereClauses = []; |
||
36 | |||
37 | /** |
||
38 | * @var array $orderByClauses |
||
39 | */ |
||
40 | private $orderByClauses = []; |
||
41 | |||
42 | /** |
||
43 | * @var array $setClauses |
||
44 | */ |
||
45 | private $setClauses = []; |
||
46 | |||
47 | /** |
||
48 | * @var array $groupByClauses |
||
49 | */ |
||
50 | private $groupByClauses = []; |
||
51 | |||
52 | /** |
||
53 | * @var array $havingClauses |
||
54 | */ |
||
55 | private $havingClauses = []; |
||
56 | |||
57 | /** |
||
58 | * @var array $hints |
||
59 | */ |
||
60 | private $hints = []; |
||
61 | |||
62 | /** |
||
63 | * @return int |
||
64 | */ |
||
65 | 22 | public function guessQueryType() |
|
73 | |||
74 | /** |
||
75 | * @return $this |
||
76 | */ |
||
77 | 21 | public function addSelect() |
|
83 | |||
84 | /** |
||
85 | * @return $this |
||
86 | */ |
||
87 | 3 | public function andWhere() |
|
93 | |||
94 | /** |
||
95 | * @return $this |
||
96 | */ |
||
97 | 1 | public function andHaving() |
|
103 | |||
104 | /** |
||
105 | * @return $this |
||
106 | */ |
||
107 | 1 | public function addOrderBy() |
|
113 | |||
114 | /** |
||
115 | * @return $this |
||
116 | */ |
||
117 | 1 | public function addSet() |
|
123 | |||
124 | /** |
||
125 | * @return $this |
||
126 | */ |
||
127 | 2 | public function addGroupBy() |
|
133 | |||
134 | /** |
||
135 | * @return $this |
||
136 | */ |
||
137 | 1 | public function addHint() |
|
143 | |||
144 | /** |
||
145 | * @return ExpressionInterface |
||
146 | */ |
||
147 | 21 | public function getSelectExpression() |
|
154 | |||
155 | /** |
||
156 | * @return ExpressionInterface |
||
157 | */ |
||
158 | 21 | public function getWhereExpression() |
|
165 | |||
166 | /** |
||
167 | * @return ExpressionInterface |
||
168 | */ |
||
169 | 21 | public function getOrderByExpression() |
|
176 | |||
177 | /** |
||
178 | * @return ExpressionInterface |
||
179 | */ |
||
180 | 1 | public function getSetExpression() |
|
187 | |||
188 | /** |
||
189 | * @return ExpressionInterface |
||
190 | */ |
||
191 | 21 | public function getGroupByExpression() |
|
198 | |||
199 | /** |
||
200 | * @return ExpressionInterface |
||
201 | */ |
||
202 | 21 | public function getHavingExpression() |
|
209 | } |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.