@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | // Handle optional AS keyword before alias |
228 | 228 | if ($token->type === Token::TYPE_KEYWORD |
229 | 229 | && $token->keyword === 'AS') { |
230 | - if ($asFound || ! empty($ret->alias)) { |
|
230 | + if ($asFound || !empty($ret->alias)) { |
|
231 | 231 | $parser->error('Potential duplicate alias of CASE expression.', $token); |
232 | 232 | break; |
233 | 233 | } |
@@ -245,11 +245,11 @@ discard block |
||
245 | 245 | |
246 | 246 | if ($asFound |
247 | 247 | || $token->type === Token::TYPE_STRING |
248 | - || ($token->type === Token::TYPE_SYMBOL && ! $token->flags & Token::FLAG_SYMBOL_VARIABLE) |
|
248 | + || ($token->type === Token::TYPE_SYMBOL && !$token->flags & Token::FLAG_SYMBOL_VARIABLE) |
|
249 | 249 | || $token->type === Token::TYPE_NONE |
250 | 250 | ) { |
251 | 251 | // An alias is expected (the keyword `AS` was previously found). |
252 | - if (! empty($ret->alias)) { |
|
252 | + if (!empty($ret->alias)) { |
|
253 | 253 | $parser->error('An alias was previously found.', $token); |
254 | 254 | break; |
255 | 255 | } |
@@ -180,7 +180,7 @@ |
||
180 | 180 | { |
181 | 181 | if (is_array($component)) { |
182 | 182 | return implode(', ', $component); |
183 | - } elseif (! empty($component->raw)) { |
|
183 | + } elseif (!empty($component->raw)) { |
|
184 | 184 | return '(' . implode(', ', $component->raw) . ')'; |
185 | 185 | } |
186 | 186 |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | |
129 | 129 | if ($state === 0) { |
130 | 130 | $ret->name = strtoupper($token->value); |
131 | - if (($token->type !== Token::TYPE_KEYWORD) || (! ($token->flags & Token::FLAG_KEYWORD_DATA_TYPE))) { |
|
131 | + if (($token->type !== Token::TYPE_KEYWORD) || (!($token->flags & Token::FLAG_KEYWORD_DATA_TYPE))) { |
|
132 | 132 | $parser->error('Unrecognized data type.', $token); |
133 | 133 | } |
134 | 134 | $state = 1; |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | $component->name : strtolower($component->name); |
167 | 167 | |
168 | 168 | $parameters = ''; |
169 | - if (! empty($component->parameters)) { |
|
169 | + if (!empty($component->parameters)) { |
|
170 | 170 | $parameters = '(' . implode(',', $component->parameters) . ')'; |
171 | 171 | } |
172 | 172 |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | } |
157 | 157 | |
158 | 158 | if ($state === 0) { |
159 | - if (! is_array($lastOption)) { |
|
159 | + if (!is_array($lastOption)) { |
|
160 | 160 | // This is a just keyword option without any value. |
161 | 161 | // This is the beginning and the end of it. |
162 | 162 | $ret->options[$lastOptionId] = $token->value; |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | |
227 | 227 | $ret->options[$lastOptionId]['expr'] .= $token->token; |
228 | 228 | |
229 | - if (! ((($token->token === '(') && ($brackets === 1)) |
|
229 | + if (!((($token->token === '(') && ($brackets === 1)) |
|
230 | 230 | || (($token->token === ')') && ($brackets === 0))) |
231 | 231 | ) { |
232 | 232 | // First pair of brackets is being skipped. |
@@ -284,12 +284,12 @@ discard block |
||
284 | 284 | |
285 | 285 | $options = array(); |
286 | 286 | foreach ($component->options as $option) { |
287 | - if (! is_array($option)) { |
|
287 | + if (!is_array($option)) { |
|
288 | 288 | $options[] = $option; |
289 | 289 | } else { |
290 | 290 | $options[] = $option['name'] |
291 | - . ((! empty($option['equals']) && $option['equals']) ? '=' : ' ') |
|
292 | - . (! empty($option['expr']) ? $option['expr'] : $option['value']); |
|
291 | + . ((!empty($option['equals']) && $option['equals']) ? '=' : ' ') |
|
292 | + . (!empty($option['expr']) ? $option['expr'] : $option['value']); |
|
293 | 293 | } |
294 | 294 | } |
295 | 295 | |
@@ -309,10 +309,10 @@ discard block |
||
309 | 309 | { |
310 | 310 | foreach ($this->options as $option) { |
311 | 311 | if (is_array($option)) { |
312 | - if (! strcasecmp($key, $option['name'])) { |
|
312 | + if (!strcasecmp($key, $option['name'])) { |
|
313 | 313 | return $getExpr ? $option['expr'] : $option['value']; |
314 | 314 | } |
315 | - } elseif (! strcasecmp($key, $option)) { |
|
315 | + } elseif (!strcasecmp($key, $option)) { |
|
316 | 316 | return true; |
317 | 317 | } |
318 | 318 | } |
@@ -331,12 +331,12 @@ discard block |
||
331 | 331 | { |
332 | 332 | foreach ($this->options as $idx => $option) { |
333 | 333 | if (is_array($option)) { |
334 | - if (! strcasecmp($key, $option['name'])) { |
|
334 | + if (!strcasecmp($key, $option['name'])) { |
|
335 | 335 | unset($this->options[$idx]); |
336 | 336 | |
337 | 337 | return true; |
338 | 338 | } |
339 | - } elseif (! strcasecmp($key, $option)) { |
|
339 | + } elseif (!strcasecmp($key, $option)) { |
|
340 | 340 | unset($this->options[$idx]); |
341 | 341 | |
342 | 342 | return true; |
@@ -160,7 +160,7 @@ |
||
160 | 160 | } |
161 | 161 | |
162 | 162 | $tmp = ''; |
163 | - if (! empty($component->inOut)) { |
|
163 | + if (!empty($component->inOut)) { |
|
164 | 164 | $tmp .= $component->inOut . ' '; |
165 | 165 | } |
166 | 166 |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | $state = 4; |
245 | 245 | } elseif ($token->type === Token::TYPE_SYMBOL || $token->type === Token::TYPE_NONE) { |
246 | 246 | $expr->name = $token->value; |
247 | - if (! $expr->isConstraint) { |
|
247 | + if (!$expr->isConstraint) { |
|
248 | 248 | $state = 2; |
249 | 249 | } |
250 | 250 | } elseif ($token->type === Token::TYPE_KEYWORD) { |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | } |
288 | 288 | $state = 5; |
289 | 289 | } elseif ($state === 5) { |
290 | - if (! empty($expr->type) || ! empty($expr->key)) { |
|
290 | + if (!empty($expr->type) || !empty($expr->key)) { |
|
291 | 291 | $ret[] = $expr; |
292 | 292 | } |
293 | 293 | $expr = new self(); |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | } |
310 | 310 | |
311 | 311 | // Last iteration was not saved. |
312 | - if (! empty($expr->type) || ! empty($expr->key)) { |
|
312 | + if (!empty($expr->type) || !empty($expr->key)) { |
|
313 | 313 | $ret[] = $expr; |
314 | 314 | } |
315 | 315 | |
@@ -347,18 +347,18 @@ discard block |
||
347 | 347 | $tmp .= Context::escape($component->name) . ' '; |
348 | 348 | } |
349 | 349 | |
350 | - if (! empty($component->type)) { |
|
350 | + if (!empty($component->type)) { |
|
351 | 351 | $tmp .= DataType::build( |
352 | 352 | $component->type, |
353 | 353 | array('lowercase' => true) |
354 | 354 | ) . ' '; |
355 | 355 | } |
356 | 356 | |
357 | - if (! empty($component->key)) { |
|
357 | + if (!empty($component->key)) { |
|
358 | 358 | $tmp .= $component->key . ' '; |
359 | 359 | } |
360 | 360 | |
361 | - if (! empty($component->references)) { |
|
361 | + if (!empty($component->references)) { |
|
362 | 362 | $tmp .= 'REFERENCES ' . $component->references . ' '; |
363 | 363 | } |
364 | 364 |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | } elseif (($token->type === Token::TYPE_OPERATOR) |
94 | 94 | && ($token->value === ',') |
95 | 95 | ) { |
96 | - if (! empty($expr->expr)) { |
|
96 | + if (!empty($expr->expr)) { |
|
97 | 97 | $ret[] = $expr; |
98 | 98 | } |
99 | 99 | $expr = new self(); |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | } |
106 | 106 | |
107 | 107 | // Last iteration was not processed. |
108 | - if (! empty($expr->expr)) { |
|
108 | + if (!empty($expr->expr)) { |
|
109 | 109 | $ret[] = $expr; |
110 | 110 | } |
111 | 111 |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | } else { |
155 | 155 | // The expression ended. |
156 | 156 | $expr->expr = trim($expr->expr); |
157 | - if (! empty($expr->expr)) { |
|
157 | + if (!empty($expr->expr)) { |
|
158 | 158 | $ret[] = $expr; |
159 | 159 | } |
160 | 160 | |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | |
172 | 172 | if (($token->type === Token::TYPE_KEYWORD) |
173 | 173 | && ($token->flags & Token::FLAG_KEYWORD_RESERVED) |
174 | - && ! ($token->flags & Token::FLAG_KEYWORD_FUNCTION) |
|
174 | + && !($token->flags & Token::FLAG_KEYWORD_FUNCTION) |
|
175 | 175 | ) { |
176 | 176 | if ($token->value === 'BETWEEN') { |
177 | 177 | $betweenBefore = true; |
@@ -195,11 +195,11 @@ discard block |
||
195 | 195 | $expr->expr .= $token->token; |
196 | 196 | if (($token->type === Token::TYPE_NONE) |
197 | 197 | || (($token->type === Token::TYPE_KEYWORD) |
198 | - && (! ($token->flags & Token::FLAG_KEYWORD_RESERVED))) |
|
198 | + && (!($token->flags & Token::FLAG_KEYWORD_RESERVED))) |
|
199 | 199 | || ($token->type === Token::TYPE_STRING) |
200 | 200 | || ($token->type === Token::TYPE_SYMBOL) |
201 | 201 | ) { |
202 | - if (! in_array($token->value, $expr->identifiers)) { |
|
202 | + if (!in_array($token->value, $expr->identifiers)) { |
|
203 | 203 | $expr->identifiers[] = $token->value; |
204 | 204 | } |
205 | 205 | } |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | |
208 | 208 | // Last iteration was not processed. |
209 | 209 | $expr->expr = trim($expr->expr); |
210 | - if (! empty($expr->expr)) { |
|
210 | + if (!empty($expr->expr)) { |
|
211 | 211 | $ret[] = $expr; |
212 | 212 | } |
213 | 213 |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | |
152 | 152 | if ($state === 0) { |
153 | 153 | if (($token->type === Token::TYPE_KEYWORD) |
154 | - && ! empty(static::$JOINS[$token->keyword]) |
|
154 | + && !empty(static::$JOINS[$token->keyword]) |
|
155 | 155 | ) { |
156 | 156 | $expr->type = static::$JOINS[$token->keyword]; |
157 | 157 | $state = 1; |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | $state = 4; |
172 | 172 | break; |
173 | 173 | default: |
174 | - if (! empty(static::$JOINS[$token->keyword]) |
|
174 | + if (!empty(static::$JOINS[$token->keyword]) |
|
175 | 175 | ) { |
176 | 176 | $ret[] = $expr; |
177 | 177 | $expr = new self(); |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | } |
198 | 198 | } |
199 | 199 | |
200 | - if (! empty($expr->type)) { |
|
200 | + if (!empty($expr->type)) { |
|
201 | 201 | $ret[] = $expr; |
202 | 202 | } |
203 | 203 | |
@@ -217,9 +217,9 @@ discard block |
||
217 | 217 | $ret = array(); |
218 | 218 | foreach ($component as $c) { |
219 | 219 | $ret[] = array_search($c->type, static::$JOINS) . ' ' . $c->expr |
220 | - . (! empty($c->on) |
|
220 | + . (!empty($c->on) |
|
221 | 221 | ? ' ON ' . Condition::build($c->on) : '') |
222 | - . (! empty($c->using) |
|
222 | + . (!empty($c->using) |
|
223 | 223 | ? ' USING ' . ArrayObj::build($c->using) : ''); |
224 | 224 | } |
225 | 225 |