@@ -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')) { |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | */ |
| 59 | 59 | public static function gettext($msgid) |
| 60 | 60 | { |
| 61 | - if (! class_exists('\PhpMyAdmin\MoTranslator\Loader', true)) { |
|
| 61 | + if (!class_exists('\PhpMyAdmin\MoTranslator\Loader', true)) { |
|
| 62 | 62 | return $msgid; |
| 63 | 63 | } |
| 64 | 64 | |
@@ -470,7 +470,7 @@ discard block |
||
| 470 | 470 | |
| 471 | 471 | // Checking if it is a known statement that can be parsed. |
| 472 | 472 | if (empty(static::$STATEMENT_PARSERS[$token->keyword])) { |
| 473 | - if (! isset(static::$STATEMENT_PARSERS[$token->keyword])) { |
|
| 473 | + if (!isset(static::$STATEMENT_PARSERS[$token->keyword])) { |
|
| 474 | 474 | // A statement is considered recognized if the parser |
| 475 | 475 | // is aware that it is a statement, but it does not have |
| 476 | 476 | // a parser for it yet. |
@@ -511,7 +511,7 @@ discard block |
||
| 511 | 511 | $prevLastIdx = $list->idx; |
| 512 | 512 | |
| 513 | 513 | // Handles unions. |
| 514 | - if (! empty($unionType) |
|
| 514 | + if (!empty($unionType) |
|
| 515 | 515 | && ($lastStatement instanceof SelectStatement) |
| 516 | 516 | && ($statement instanceof SelectStatement) |
| 517 | 517 | ) { |