@@ -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; |
@@ -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 | } |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | |
| 314 | 314 | // Parsing the delimiter. |
| 315 | 315 | $delimiter = ''; |
| 316 | - while (($i < $len) && (! Context::isWhitespace($this->query[$i]))) { |
|
| 316 | + while (($i < $len) && (!Context::isWhitespace($this->query[$i]))) { |
|
| 317 | 317 | $delimiter .= $this->query[$i++]; |
| 318 | 318 | } |
| 319 | 319 | |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | |
| 328 | 328 | // Whether this statement should be returned or not. |
| 329 | 329 | $ret = ''; |
| 330 | - if (! empty($this->options['parse_delimiter'])) { |
|
| 330 | + if (!empty($this->options['parse_delimiter'])) { |
|
| 331 | 331 | // Appending the `DELIMITER` statement that was just |
| 332 | 332 | // found to the current statement. |
| 333 | 333 | $ret = trim( |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | $ret = $this->current; |
| 370 | 370 | |
| 371 | 371 | // If needed, adds a delimiter at the end of the statement. |
| 372 | - if (! empty($this->options['add_delimiter'])) { |
|
| 372 | + if (!empty($this->options['add_delimiter'])) { |
|
| 373 | 373 | $ret .= $this->delimiter; |
| 374 | 374 | } |
| 375 | 375 | |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | */ |
| 45 | 45 | public function __construct(array $tokens = array(), $count = -1) |
| 46 | 46 | { |
| 47 | - if (! empty($tokens)) { |
|
| 47 | + if (!empty($tokens)) { |
|
| 48 | 48 | $this->tokens = $tokens; |
| 49 | 49 | if ($count === -1) { |
| 50 | 50 | $this->count = count($tokens); |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | |
| 169 | 169 | // Checking if this field was already built. |
| 170 | 170 | if ($type & 1) { |
| 171 | - if (! empty($built[$field])) { |
|
| 171 | + if (!empty($built[$field])) { |
|
| 172 | 172 | continue; |
| 173 | 173 | } |
| 174 | 174 | $built[$field] = true; |
@@ -306,10 +306,10 @@ discard block |
||
| 306 | 306 | $options = array(); |
| 307 | 307 | |
| 308 | 308 | // Looking for duplicated clauses. |
| 309 | - if (! empty(Parser::$KEYWORD_PARSERS[$token->value]) |
|
| 310 | - || ! empty(Parser::$STATEMENT_PARSERS[$token->value]) |
|
| 309 | + if (!empty(Parser::$KEYWORD_PARSERS[$token->value]) |
|
| 310 | + || !empty(Parser::$STATEMENT_PARSERS[$token->value]) |
|
| 311 | 311 | ) { |
| 312 | - if (! empty($parsedClauses[$token->value])) { |
|
| 312 | + if (!empty($parsedClauses[$token->value])) { |
|
| 313 | 313 | $parser->error( |
| 314 | 314 | 'This type of clause was previously parsed.', |
| 315 | 315 | $token |
@@ -324,17 +324,17 @@ discard block |
||
| 324 | 324 | // but it might be the beginning of a statement of truncate, |
| 325 | 325 | // so let the value use the keyword field for truncate type. |
| 326 | 326 | $token_value = in_array($token->keyword, array('TRUNCATE')) ? $token->keyword : $token->value; |
| 327 | - if (! empty(Parser::$KEYWORD_PARSERS[$token_value]) && $list->idx < $list->count) { |
|
| 327 | + if (!empty(Parser::$KEYWORD_PARSERS[$token_value]) && $list->idx < $list->count) { |
|
| 328 | 328 | $class = Parser::$KEYWORD_PARSERS[$token_value]['class']; |
| 329 | 329 | $field = Parser::$KEYWORD_PARSERS[$token_value]['field']; |
| 330 | - if (! empty(Parser::$KEYWORD_PARSERS[$token_value]['options'])) { |
|
| 330 | + if (!empty(Parser::$KEYWORD_PARSERS[$token_value]['options'])) { |
|
| 331 | 331 | $options = Parser::$KEYWORD_PARSERS[$token_value]['options']; |
| 332 | 332 | } |
| 333 | 333 | } |
| 334 | 334 | |
| 335 | 335 | // Checking if this is the beginning of the statement. |
| 336 | - if (! empty(Parser::$STATEMENT_PARSERS[$token->keyword])) { |
|
| 337 | - if (! empty(static::$CLAUSES) // Undefined for some statements. |
|
| 336 | + if (!empty(Parser::$STATEMENT_PARSERS[$token->keyword])) { |
|
| 337 | + if (!empty(static::$CLAUSES) // Undefined for some statements. |
|
| 338 | 338 | && empty(static::$CLAUSES[$token->value]) |
| 339 | 339 | ) { |
| 340 | 340 | // Some keywords (e.g. `SET`) may be the beginning of a |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | ); |
| 349 | 349 | break; |
| 350 | 350 | } |
| 351 | - if (! $parsedOptions) { |
|
| 351 | + if (!$parsedOptions) { |
|
| 352 | 352 | if (empty(static::$OPTIONS[$token->value])) { |
| 353 | 353 | // Skipping keyword because if it is not a option. |
| 354 | 354 | ++$list->idx; |
@@ -528,7 +528,7 @@ discard block |
||
| 528 | 528 | if ($minJoin === 0 && stripos($clauseType, 'JOIN')) { |
| 529 | 529 | // First JOIN clause is detected |
| 530 | 530 | $minJoin = $maxJoin = $clauseStartIdx; |
| 531 | - } elseif ($minJoin !== 0 && ! stripos($clauseType, 'JOIN')) { |
|
| 531 | + } elseif ($minJoin !== 0 && !stripos($clauseType, 'JOIN')) { |
|
| 532 | 532 | // After a previous JOIN clause, a non-JOIN clause has been detected |
| 533 | 533 | $maxJoin = $lastIdx; |
| 534 | 534 | } elseif ($maxJoin < $clauseStartIdx && stripos($clauseType, 'JOIN')) { |