@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | use PhpMyAdmin\SqlParser\Exceptions\LexerException; |
14 | 14 | |
15 | -if (! defined('USE_UTF_STRINGS')) { |
|
15 | +if (!defined('USE_UTF_STRINGS')) { |
|
16 | 16 | // NOTE: In previous versions of PHP (5.5 and older) the default |
17 | 17 | // internal encoding is "ISO-8859-1". |
18 | 18 | // All `mb_` functions must specify the correct encoding, which is |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | |
174 | 174 | // For multi-byte strings, a new instance of `UtfString` is |
175 | 175 | // initialized (only if `UtfString` usage is forced. |
176 | - if (! $str instanceof UtfString && USE_UTF_STRINGS && $len !== mb_strlen($str, 'UTF-8')) { |
|
176 | + if (!$str instanceof UtfString && USE_UTF_STRINGS && $len !== mb_strlen($str, 'UTF-8')) { |
|
177 | 177 | $str = new UtfString($str); |
178 | 178 | } |
179 | 179 | |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | |
185 | 185 | // Setting the delimiter. |
186 | 186 | $this->setDelimiter( |
187 | - ! empty($delimiter) ? $delimiter : static::$DEFAULT_DELIMITER |
|
187 | + !empty($delimiter) ? $delimiter : static::$DEFAULT_DELIMITER |
|
188 | 188 | ); |
189 | 189 | |
190 | 190 | $this->lex(); |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | // Parsing the delimiter. |
313 | 313 | $this->delimiter = null; |
314 | 314 | $delimiterLen = 0; |
315 | - while (++$this->last < $this->len && ! Context::isWhitespace($this->str[$this->last]) && $delimiterLen < 15) { |
|
315 | + while (++$this->last < $this->len && !Context::isWhitespace($this->str[$this->last]) && $delimiterLen < 15) { |
|
316 | 316 | $this->delimiter .= $this->str[$this->last]; |
317 | 317 | ++$delimiterLen; |
318 | 318 | } |
@@ -550,7 +550,7 @@ discard block |
||
550 | 550 | { |
551 | 551 | $token = $this->str[$this->last]; |
552 | 552 | |
553 | - if (! Context::isWhitespace($token)) { |
|
553 | + if (!Context::isWhitespace($token)) { |
|
554 | 554 | return null; |
555 | 555 | } |
556 | 556 | |
@@ -596,7 +596,7 @@ discard block |
||
596 | 596 | // This can occurs in the following statements: |
597 | 597 | // - "SELECT */* comment */ FROM ..." |
598 | 598 | // - "SELECT 2*/* comment */3 AS `six`;" |
599 | - $next = $this->last+1; |
|
599 | + $next = $this->last + 1; |
|
600 | 600 | if (($next < $this->len) && $this->str[$next] === '*') { |
601 | 601 | // Conflict in "*/*": first "*" was not for ending a comment. |
602 | 602 | // Stop here and let other parsing method define the true behavior of that first star. |
@@ -786,7 +786,7 @@ discard block |
||
786 | 786 | } |
787 | 787 | } elseif ($state === 2) { |
788 | 788 | $flags |= Token::FLAG_NUMBER_HEX; |
789 | - if (! ( |
|
789 | + if (!( |
|
790 | 790 | ($this->str[$this->last] >= '0' && $this->str[$this->last] <= '9') |
791 | 791 | || ($this->str[$this->last] >= 'A' && $this->str[$this->last] <= 'F') |
792 | 792 | || ($this->str[$this->last] >= 'a' && $this->str[$this->last] <= 'f') |
@@ -881,7 +881,7 @@ discard block |
||
881 | 881 | public function parseString($quote = '') |
882 | 882 | { |
883 | 883 | $token = $this->str[$this->last]; |
884 | - if (! ($flags = Context::isString($token)) && $token !== $quote) { |
|
884 | + if (!($flags = Context::isString($token)) && $token !== $quote) { |
|
885 | 885 | return null; |
886 | 886 | } |
887 | 887 | $quote = $token; |
@@ -927,7 +927,7 @@ discard block |
||
927 | 927 | public function parseSymbol() |
928 | 928 | { |
929 | 929 | $token = $this->str[$this->last]; |
930 | - if (! ($flags = Context::isSymbol($token))) { |
|
930 | + if (!($flags = Context::isSymbol($token))) { |
|
931 | 931 | return null; |
932 | 932 | } |
933 | 933 | |
@@ -978,7 +978,7 @@ discard block |
||
978 | 978 | return null; |
979 | 979 | } |
980 | 980 | |
981 | - while (++$this->last < $this->len && ! Context::isSeparator($this->str[$this->last])) { |
|
981 | + while (++$this->last < $this->len && !Context::isSeparator($this->str[$this->last])) { |
|
982 | 982 | $token .= $this->str[$this->last]; |
983 | 983 | |
984 | 984 | // Test if end of token equals the current delimiter. If so, remove it from the token. |
@@ -277,12 +277,12 @@ discard block |
||
277 | 277 | } elseif (($token->value === ',') && ($brackets === 0)) { |
278 | 278 | break; |
279 | 279 | } |
280 | - } elseif (! self::checkIfTokenQuotedSymbol($token)) { |
|
281 | - if (! empty(Parser::$STATEMENT_PARSERS[$token->value])) { |
|
280 | + } elseif (!self::checkIfTokenQuotedSymbol($token)) { |
|
281 | + if (!empty(Parser::$STATEMENT_PARSERS[$token->value])) { |
|
282 | 282 | // We have reached the end of ALTER operation and suddenly found |
283 | 283 | // a start to new statement, but have not find a delimiter between them |
284 | 284 | |
285 | - if (! ($token->value === 'SET' && $list->tokens[$list->idx - 1]->value === 'CHARACTER')) { |
|
285 | + if (!($token->value === 'SET' && $list->tokens[$list->idx - 1]->value === 'CHARACTER')) { |
|
286 | 286 | $parser->error( |
287 | 287 | 'A new statement was found, but no delimiter between it and the previous one.', |
288 | 288 | $token |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | } |
292 | 292 | } elseif ((array_key_exists($array_key, self::$DB_OPTIONS) |
293 | 293 | || array_key_exists($array_key, self::$TABLE_OPTIONS)) |
294 | - && ! self::checkIfColumnDefinitionKeyword($array_key) |
|
294 | + && !self::checkIfColumnDefinitionKeyword($array_key) |
|
295 | 295 | ) { |
296 | 296 | // This alter operation has finished, which means a comma was missing before start of new alter operation |
297 | 297 | $parser->error( |