@@ -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 |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $isList = $list instanceof TokensList; |
77 | 77 | |
78 | 78 | // Parsing the tokens. |
79 | - if (! $isList) { |
|
79 | + if (!$isList) { |
|
80 | 80 | $list = Lexer::getTokens($list); |
81 | 81 | } |
82 | 82 | |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | ++$j; |
137 | 137 | } |
138 | 138 | |
139 | - if (! static::match($list->tokens[$j], $find[$k])) { |
|
139 | + if (!static::match($list->tokens[$j], $find[$k])) { |
|
140 | 140 | // This token does not match the pattern. |
141 | 141 | break; |
142 | 142 | } |
@@ -258,12 +258,12 @@ discard block |
||
258 | 258 | /* Sanitize the array so that we do not have to care later */ |
259 | 259 | foreach ($newFormats as $j => $new) { |
260 | 260 | foreach ($integers as $name) { |
261 | - if (! isset($new[$name])) { |
|
261 | + if (!isset($new[$name])) { |
|
262 | 262 | $newFormats[$j][$name] = 0; |
263 | 263 | } |
264 | 264 | } |
265 | 265 | foreach ($strings as $name) { |
266 | - if (! isset($new[$name])) { |
|
266 | + if (!isset($new[$name])) { |
|
267 | 267 | $newFormats[$j][$name] = ''; |
268 | 268 | } |
269 | 269 | } |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | |
284 | 284 | /* Add not already handled formats */ |
285 | 285 | foreach ($newFormats as $j => $new) { |
286 | - if (! in_array($j, $added)) { |
|
286 | + if (!in_array($j, $added)) { |
|
287 | 287 | $formats[] = $new; |
288 | 288 | } |
289 | 289 | } |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | |
411 | 411 | // The options of a clause should stay on the same line and everything that follows. |
412 | 412 | if ($this->options['parts_newline'] |
413 | - && ! $formattedOptions |
|
413 | + && !$formattedOptions |
|
414 | 414 | && empty(self::$INLINE_CLAUSES[$lastClause]) |
415 | 415 | && ( |
416 | 416 | $curr->type !== Token::TYPE_KEYWORD |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | if (end($blocksLineEndings) === true |
463 | 463 | || ( |
464 | 464 | empty(self::$INLINE_CLAUSES[$lastClause]) |
465 | - && ! $shortGroup |
|
465 | + && !$shortGroup |
|
466 | 466 | && $this->options['parts_newline'] |
467 | 467 | ) |
468 | 468 | ) { |
@@ -502,7 +502,7 @@ discard block |
||
502 | 502 | // Also, some tokens do not have spaces before or after them. |
503 | 503 | if (// A space after delimiters that are longer than 2 characters. |
504 | 504 | $prev->keyword === 'DELIMITER' |
505 | - || ! ( |
|
505 | + || !( |
|
506 | 506 | ($prev->type === Token::TYPE_OPERATOR && ($prev->value === '.' || $prev->value === '(')) |
507 | 507 | // No space after . ( |
508 | 508 | || ($curr->type === Token::TYPE_OPERATOR && ($curr->value === '.' || $curr->value === ',' || $curr->value === '(' || $curr->value === ')')) |
@@ -618,7 +618,7 @@ discard block |
||
618 | 618 | && ($token->flags & $format['flags']) === $format['flags'] |
619 | 619 | ) { |
620 | 620 | // Running transformation function. |
621 | - if (! empty($format['function'])) { |
|
621 | + if (!empty($format['function'])) { |
|
622 | 622 | $func = $format['function']; |
623 | 623 | $text = $func($text); |
624 | 624 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | */ |
29 | 29 | public static function getAliases($statement, $database) |
30 | 30 | { |
31 | - if (! ($statement instanceof SelectStatement) |
|
31 | + if (!($statement instanceof SelectStatement) |
|
32 | 32 | || empty($statement->expr) |
33 | 33 | || empty($statement->from) |
34 | 34 | ) { |
@@ -48,28 +48,28 @@ discard block |
||
48 | 48 | $expressions = $statement->from; |
49 | 49 | |
50 | 50 | // Adding expressions from JOIN. |
51 | - if (! empty($statement->join)) { |
|
51 | + if (!empty($statement->join)) { |
|
52 | 52 | foreach ($statement->join as $join) { |
53 | 53 | $expressions[] = $join->expr; |
54 | 54 | } |
55 | 55 | } |
56 | 56 | |
57 | 57 | foreach ($expressions as $expr) { |
58 | - if (! isset($expr->table) || ($expr->table === '')) { |
|
58 | + if (!isset($expr->table) || ($expr->table === '')) { |
|
59 | 59 | continue; |
60 | 60 | } |
61 | 61 | |
62 | 62 | $thisDb = (isset($expr->database) && ($expr->database !== '')) ? |
63 | 63 | $expr->database : $database; |
64 | 64 | |
65 | - if (! isset($retval[$thisDb])) { |
|
65 | + if (!isset($retval[$thisDb])) { |
|
66 | 66 | $retval[$thisDb] = array( |
67 | 67 | 'alias' => null, |
68 | 68 | 'tables' => array() |
69 | 69 | ); |
70 | 70 | } |
71 | 71 | |
72 | - if (! isset($retval[$thisDb]['tables'][$expr->table])) { |
|
72 | + if (!isset($retval[$thisDb]['tables'][$expr->table])) { |
|
73 | 73 | $retval[$thisDb]['tables'][$expr->table] = array( |
74 | 74 | 'alias' => (isset($expr->alias) && ($expr->alias !== '')) ? |
75 | 75 | $expr->alias : null, |
@@ -77,14 +77,14 @@ discard block |
||
77 | 77 | ); |
78 | 78 | } |
79 | 79 | |
80 | - if (! isset($tables[$thisDb])) { |
|
80 | + if (!isset($tables[$thisDb])) { |
|
81 | 81 | $tables[$thisDb] = array(); |
82 | 82 | } |
83 | 83 | $tables[$thisDb][$expr->alias] = $expr->table; |
84 | 84 | } |
85 | 85 | |
86 | 86 | foreach ($statement->expr as $expr) { |
87 | - if (! isset($expr->column, $expr->alias) || ($expr->column === '') || ($expr->alias === '') |
|
87 | + if (!isset($expr->column, $expr->alias) || ($expr->column === '') || ($expr->alias === '') |
|
88 | 88 | ) { |
89 | 89 | continue; |
90 | 90 | } |
@@ -55,10 +55,10 @@ |
||
55 | 55 | return false; |
56 | 56 | } |
57 | 57 | $this->mergeLongOpts($params, $longopts); |
58 | - if (! isset($params['f'])) { |
|
58 | + if (!isset($params['f'])) { |
|
59 | 59 | $params['f'] = 'cli'; |
60 | 60 | } |
61 | - if (! in_array($params['f'], array('html', 'cli', 'text'))) { |
|
61 | + if (!in_array($params['f'], array('html', 'cli', 'text'))) { |
|
62 | 62 | echo "ERROR: Invalid value for format!\n"; |
63 | 63 | |
64 | 64 | return false; |
@@ -118,7 +118,7 @@ |
||
118 | 118 | 'opts' => array() |
119 | 119 | ); |
120 | 120 | |
121 | - if (! empty($statement->parameters)) { |
|
121 | + if (!empty($statement->parameters)) { |
|
122 | 122 | $idx = 0; |
123 | 123 | foreach ($statement->parameters as $param) { |
124 | 124 | $retval['dir'][$idx] = $param->inOut; |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | $flags['querytype'] = 'SELECT'; |
228 | 228 | $flags['is_select'] = true; |
229 | 229 | |
230 | - if (! empty($statement->from)) { |
|
230 | + if (!empty($statement->from)) { |
|
231 | 231 | $flags['select_from'] = true; |
232 | 232 | } |
233 | 233 | |
@@ -235,55 +235,55 @@ discard block |
||
235 | 235 | $flags['distinct'] = true; |
236 | 236 | } |
237 | 237 | |
238 | - if (! empty($statement->group) || ! empty($statement->having)) { |
|
238 | + if (!empty($statement->group) || !empty($statement->having)) { |
|
239 | 239 | $flags['is_group'] = true; |
240 | 240 | } |
241 | 241 | |
242 | - if (! empty($statement->into) |
|
242 | + if (!empty($statement->into) |
|
243 | 243 | && ($statement->into->type === 'OUTFILE') |
244 | 244 | ) { |
245 | 245 | $flags['is_export'] = true; |
246 | 246 | } |
247 | 247 | |
248 | 248 | $expressions = $statement->expr; |
249 | - if (! empty($statement->join)) { |
|
249 | + if (!empty($statement->join)) { |
|
250 | 250 | foreach ($statement->join as $join) { |
251 | 251 | $expressions[] = $join->expr; |
252 | 252 | } |
253 | 253 | } |
254 | 254 | |
255 | 255 | foreach ($expressions as $expr) { |
256 | - if (! empty($expr->function)) { |
|
256 | + if (!empty($expr->function)) { |
|
257 | 257 | if ($expr->function === 'COUNT') { |
258 | 258 | $flags['is_count'] = true; |
259 | 259 | } elseif (in_array($expr->function, static::$FUNCTIONS)) { |
260 | 260 | $flags['is_func'] = true; |
261 | 261 | } |
262 | 262 | } |
263 | - if (! empty($expr->subquery)) { |
|
263 | + if (!empty($expr->subquery)) { |
|
264 | 264 | $flags['is_subquery'] = true; |
265 | 265 | } |
266 | 266 | } |
267 | 267 | |
268 | - if (! empty($statement->procedure) |
|
268 | + if (!empty($statement->procedure) |
|
269 | 269 | && ($statement->procedure->name === 'ANALYSE') |
270 | 270 | ) { |
271 | 271 | $flags['is_analyse'] = true; |
272 | 272 | } |
273 | 273 | |
274 | - if (! empty($statement->group)) { |
|
274 | + if (!empty($statement->group)) { |
|
275 | 275 | $flags['group'] = true; |
276 | 276 | } |
277 | 277 | |
278 | - if (! empty($statement->having)) { |
|
278 | + if (!empty($statement->having)) { |
|
279 | 279 | $flags['having'] = true; |
280 | 280 | } |
281 | 281 | |
282 | - if (! empty($statement->union)) { |
|
282 | + if (!empty($statement->union)) { |
|
283 | 283 | $flags['union'] = true; |
284 | 284 | } |
285 | 285 | |
286 | - if (! empty($statement->join)) { |
|
286 | + if (!empty($statement->join)) { |
|
287 | 287 | $flags['join'] = true; |
288 | 288 | } |
289 | 289 | |
@@ -374,10 +374,10 @@ discard block |
||
374 | 374 | || ($statement instanceof UpdateStatement) |
375 | 375 | || ($statement instanceof DeleteStatement) |
376 | 376 | ) { |
377 | - if (! empty($statement->limit)) { |
|
377 | + if (!empty($statement->limit)) { |
|
378 | 378 | $flags['limit'] = true; |
379 | 379 | } |
380 | - if (! empty($statement->order)) { |
|
380 | + if (!empty($statement->order)) { |
|
381 | 381 | $flags['order'] = true; |
382 | 382 | } |
383 | 383 | } |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | $expr->database : null |
446 | 446 | ); |
447 | 447 | } |
448 | - if (! in_array($arr, $ret['select_tables'])) { |
|
448 | + if (!in_array($arr, $ret['select_tables'])) { |
|
449 | 449 | $ret['select_tables'][] = $arr; |
450 | 450 | } |
451 | 451 | } else { |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | (isset($expr->database) && ($expr->database !== '')) ? |
465 | 465 | $expr->database : null |
466 | 466 | ); |
467 | - if (! in_array($arr, $ret['select_tables'])) { |
|
467 | + if (!in_array($arr, $ret['select_tables'])) { |
|
468 | 468 | $ret['select_tables'][] = $arr; |
469 | 469 | } |
470 | 470 | } |
@@ -501,7 +501,7 @@ discard block |
||
501 | 501 | ) { |
502 | 502 | $expressions = array($statement->table); |
503 | 503 | } elseif ($statement instanceof DropStatement) { |
504 | - if (! $statement->options->has('TABLE')) { |
|
504 | + if (!$statement->options->has('TABLE')) { |
|
505 | 505 | // No tables are dropped. |
506 | 506 | return array(); |
507 | 507 | } |
@@ -514,7 +514,7 @@ discard block |
||
514 | 514 | |
515 | 515 | $ret = array(); |
516 | 516 | foreach ($expressions as $expr) { |
517 | - if (! empty($expr->table)) { |
|
517 | + if (!empty($expr->table)) { |
|
518 | 518 | $expr->expr = null; // Force rebuild. |
519 | 519 | $expr->alias = null; // Aliases are not required. |
520 | 520 | $ret[] = Expression::build($expr); |
@@ -786,7 +786,7 @@ discard block |
||
786 | 786 | |
787 | 787 | $statement .= $token->token; |
788 | 788 | |
789 | - if (($token->type === Token::TYPE_DELIMITER) && ! empty($token->token)) { |
|
789 | + if (($token->type === Token::TYPE_DELIMITER) && !empty($token->token)) { |
|
790 | 790 | $delimiter = $token->token; |
791 | 791 | $fullStatement = true; |
792 | 792 | break; |
@@ -795,7 +795,7 @@ discard block |
||
795 | 795 | |
796 | 796 | // No statement was found so we return the entire query as being the |
797 | 797 | // remaining part. |
798 | - if (! $fullStatement) { |
|
798 | + if (!$fullStatement) { |
|
799 | 799 | return array( |
800 | 800 | null, |
801 | 801 | $query, |
@@ -27,8 +27,8 @@ discard block |
||
27 | 27 | public static function getForeignKeys($statement) |
28 | 28 | { |
29 | 29 | if (empty($statement->fields) |
30 | - || (! is_array($statement->fields)) |
|
31 | - || (! $statement->options->has('TABLE')) |
|
30 | + || (!is_array($statement->fields)) |
|
31 | + || (!$statement->options->has('TABLE')) |
|
32 | 32 | ) { |
33 | 33 | return array(); |
34 | 34 | } |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | 'index_list' => $columns |
51 | 51 | ); |
52 | 52 | |
53 | - if (! empty($field->references)) { |
|
53 | + if (!empty($field->references)) { |
|
54 | 54 | $tmp['ref_db_name'] = $field->references->table->database; |
55 | 55 | $tmp['ref_table_name'] = $field->references->table->table; |
56 | 56 | $tmp['ref_index_list'] = $field->references->columns; |
@@ -84,8 +84,8 @@ discard block |
||
84 | 84 | public static function getFields($statement) |
85 | 85 | { |
86 | 86 | if (empty($statement->fields) |
87 | - || (! is_array($statement->fields)) |
|
88 | - || (! $statement->options->has('TABLE')) |
|
87 | + || (!is_array($statement->fields)) |
|
88 | + || (!$statement->options->has('TABLE')) |
|
89 | 89 | ) { |
90 | 90 | return array(); |
91 | 91 | } |