@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | |
| 123 | 123 | if ($lastOption === null) { |
| 124 | 124 | $upper = strtoupper($token->token); |
| 125 | - if (! isset($options[$upper])) { |
|
| 125 | + if (!isset($options[$upper])) { |
|
| 126 | 126 | // There is no option to be processed. |
| 127 | 127 | break; |
| 128 | 128 | } |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | if ($state === 0) { |
| 162 | - if (! is_array($lastOption)) { |
|
| 162 | + if (!is_array($lastOption)) { |
|
| 163 | 163 | // This is a just keyword option without any value. |
| 164 | 164 | // This is the beginning and the end of it. |
| 165 | 165 | $ret->options[$lastOptionId] = $token->value; |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | |
| 233 | 233 | $ret->options[$lastOptionId]['expr'] .= $token->token; |
| 234 | 234 | |
| 235 | - if (! (($token->token === '(') && ($brackets === 1) |
|
| 235 | + if (!(($token->token === '(') && ($brackets === 1) |
|
| 236 | 236 | || (($token->token === ')') && ($brackets === 0))) |
| 237 | 237 | ) { |
| 238 | 238 | // First pair of brackets is being skipped. |
@@ -289,12 +289,12 @@ discard block |
||
| 289 | 289 | |
| 290 | 290 | $options = []; |
| 291 | 291 | foreach ($component->options as $option) { |
| 292 | - if (! is_array($option)) { |
|
| 292 | + if (!is_array($option)) { |
|
| 293 | 293 | $options[] = $option; |
| 294 | 294 | } else { |
| 295 | 295 | $options[] = $option['name'] |
| 296 | - . (! empty($option['equals']) && $option['equals'] ? '=' : ' ') |
|
| 297 | - . (! empty($option['expr']) ? $option['expr'] : $option['value']); |
|
| 296 | + . (!empty($option['equals']) && $option['equals'] ? '=' : ' ') |
|
| 297 | + . (!empty($option['expr']) ? $option['expr'] : $option['value']); |
|
| 298 | 298 | } |
| 299 | 299 | } |
| 300 | 300 | |
@@ -314,10 +314,10 @@ discard block |
||
| 314 | 314 | { |
| 315 | 315 | foreach ($this->options as $option) { |
| 316 | 316 | if (is_array($option)) { |
| 317 | - if (! strcasecmp($key, $option['name'])) { |
|
| 317 | + if (!strcasecmp($key, $option['name'])) { |
|
| 318 | 318 | return $getExpr ? $option['expr'] : $option['value']; |
| 319 | 319 | } |
| 320 | - } elseif (! strcasecmp($key, $option)) { |
|
| 320 | + } elseif (!strcasecmp($key, $option)) { |
|
| 321 | 321 | return true; |
| 322 | 322 | } |
| 323 | 323 | } |
@@ -336,12 +336,12 @@ discard block |
||
| 336 | 336 | { |
| 337 | 337 | foreach ($this->options as $idx => $option) { |
| 338 | 338 | if (is_array($option)) { |
| 339 | - if (! strcasecmp($key, $option['name'])) { |
|
| 339 | + if (!strcasecmp($key, $option['name'])) { |
|
| 340 | 340 | unset($this->options[$idx]); |
| 341 | 341 | |
| 342 | 342 | return true; |
| 343 | 343 | } |
| 344 | - } elseif (! strcasecmp($key, $option)) { |
|
| 344 | + } elseif (!strcasecmp($key, $option)) { |
|
| 345 | 345 | unset($this->options[$idx]); |
| 346 | 346 | |
| 347 | 347 | return true; |
@@ -181,7 +181,7 @@ |
||
| 181 | 181 | return implode(', ', $component); |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | - if (! empty($component->raw)) { |
|
| 184 | + if (!empty($component->raw)) { |
|
| 185 | 185 | return '(' . implode(', ', $component->raw) . ')'; |
| 186 | 186 | } |
| 187 | 187 | |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | use function strlen; |
| 21 | 21 | use function substr; |
| 22 | 22 | |
| 23 | -if (! defined('USE_UTF_STRINGS')) { |
|
| 23 | +if (!defined('USE_UTF_STRINGS')) { |
|
| 24 | 24 | // NOTE: In previous versions of PHP (5.5 and older) the default |
| 25 | 25 | // internal encoding is "ISO-8859-1". |
| 26 | 26 | // All `mb_` functions must specify the correct encoding, which is |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | |
| 176 | 176 | // For multi-byte strings, a new instance of `UtfString` is |
| 177 | 177 | // initialized (only if `UtfString` usage is forced. |
| 178 | - if (! $str instanceof UtfString && USE_UTF_STRINGS && $len !== mb_strlen($str, 'UTF-8')) { |
|
| 178 | + if (!$str instanceof UtfString && USE_UTF_STRINGS && $len !== mb_strlen($str, 'UTF-8')) { |
|
| 179 | 179 | $str = new UtfString($str); |
| 180 | 180 | } |
| 181 | 181 | |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | |
| 187 | 187 | // Setting the delimiter. |
| 188 | 188 | $this->setDelimiter( |
| 189 | - ! empty($delimiter) ? $delimiter : static::$DEFAULT_DELIMITER |
|
| 189 | + !empty($delimiter) ? $delimiter : static::$DEFAULT_DELIMITER |
|
| 190 | 190 | ); |
| 191 | 191 | |
| 192 | 192 | $this->lex(); |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | $this->delimiter = null; |
| 321 | 321 | $delimiterLen = 0; |
| 322 | 322 | while (++$this->last < $this->len |
| 323 | - && ! Context::isWhitespace($this->str[$this->last]) |
|
| 323 | + && !Context::isWhitespace($this->str[$this->last]) |
|
| 324 | 324 | && $delimiterLen < 15 |
| 325 | 325 | ) { |
| 326 | 326 | $this->delimiter .= $this->str[$this->last]; |
@@ -383,8 +383,8 @@ discard block |
||
| 383 | 383 | continue; |
| 384 | 384 | } |
| 385 | 385 | |
| 386 | - if (($next->type !== Token::TYPE_KEYWORD || ! in_array($next->value, ['FROM', 'USING'], true)) |
|
| 387 | - && ($next->type !== Token::TYPE_OPERATOR || ! in_array($next->value, [',', ')'], true)) |
|
| 386 | + if (($next->type !== Token::TYPE_KEYWORD || !in_array($next->value, ['FROM', 'USING'], true)) |
|
| 387 | + && ($next->type !== Token::TYPE_OPERATOR || !in_array($next->value, [',', ')'], true)) |
|
| 388 | 388 | ) { |
| 389 | 389 | continue; |
| 390 | 390 | } |
@@ -462,7 +462,7 @@ discard block |
||
| 462 | 462 | $token .= $this->str[$this->last]; |
| 463 | 463 | $flags = Context::isKeyword($token); |
| 464 | 464 | |
| 465 | - if (($this->last + 1 !== $this->len && ! Context::isSeparator($this->str[$this->last + 1])) || ! $flags) { |
|
| 465 | + if (($this->last + 1 !== $this->len && !Context::isSeparator($this->str[$this->last + 1])) || !$flags) { |
|
| 466 | 466 | continue; |
| 467 | 467 | } |
| 468 | 468 | |
@@ -554,7 +554,7 @@ discard block |
||
| 554 | 554 | $token .= $this->str[$this->last]; |
| 555 | 555 | $flags = Context::isOperator($token); |
| 556 | 556 | |
| 557 | - if (! $flags) { |
|
| 557 | + if (!$flags) { |
|
| 558 | 558 | continue; |
| 559 | 559 | } |
| 560 | 560 | |
@@ -576,7 +576,7 @@ discard block |
||
| 576 | 576 | { |
| 577 | 577 | $token = $this->str[$this->last]; |
| 578 | 578 | |
| 579 | - if (! Context::isWhitespace($token)) { |
|
| 579 | + if (!Context::isWhitespace($token)) { |
|
| 580 | 580 | return null; |
| 581 | 581 | } |
| 582 | 582 | |
@@ -818,7 +818,7 @@ discard block |
||
| 818 | 818 | } |
| 819 | 819 | } elseif ($state === 2) { |
| 820 | 820 | $flags |= Token::FLAG_NUMBER_HEX; |
| 821 | - if (! ( |
|
| 821 | + if (!( |
|
| 822 | 822 | ($this->str[$this->last] >= '0' && $this->str[$this->last] <= '9') |
| 823 | 823 | || ($this->str[$this->last] >= 'A' && $this->str[$this->last] <= 'F') |
| 824 | 824 | || ($this->str[$this->last] >= 'a' && $this->str[$this->last] <= 'f') |
@@ -919,7 +919,7 @@ discard block |
||
| 919 | 919 | $token = $this->str[$this->last]; |
| 920 | 920 | $flags = Context::isString($token); |
| 921 | 921 | |
| 922 | - if (! $flags && $token !== $quote) { |
|
| 922 | + if (!$flags && $token !== $quote) { |
|
| 923 | 923 | return null; |
| 924 | 924 | } |
| 925 | 925 | |
@@ -970,7 +970,7 @@ discard block |
||
| 970 | 970 | $token = $this->str[$this->last]; |
| 971 | 971 | $flags = Context::isSymbol($token); |
| 972 | 972 | |
| 973 | - if (! $flags) { |
|
| 973 | + if (!$flags) { |
|
| 974 | 974 | return null; |
| 975 | 975 | } |
| 976 | 976 | |
@@ -1025,7 +1025,7 @@ discard block |
||
| 1025 | 1025 | return null; |
| 1026 | 1026 | } |
| 1027 | 1027 | |
| 1028 | - while (++$this->last < $this->len && ! Context::isSeparator($this->str[$this->last])) { |
|
| 1028 | + while (++$this->last < $this->len && !Context::isSeparator($this->str[$this->last])) { |
|
| 1029 | 1029 | $token .= $this->str[$this->last]; |
| 1030 | 1030 | |
| 1031 | 1031 | // Test if end of token equals the current delimiter. If so, remove it from the token. |
@@ -99,7 +99,7 @@ |
||
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | if ($state === 1) { |
| 102 | - if (! $this->isLock) { |
|
| 102 | + if (!$this->isLock) { |
|
| 103 | 103 | // UNLOCK statement should not have any more tokens |
| 104 | 104 | $parser->error('Unexpected token.', $token); |
| 105 | 105 | break; |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | public function build() |
| 376 | 376 | { |
| 377 | 377 | $fields = ''; |
| 378 | - if (! empty($this->fields)) { |
|
| 378 | + if (!empty($this->fields)) { |
|
| 379 | 379 | if (is_array($this->fields)) { |
| 380 | 380 | $fields = CreateDefinition::build($this->fields) . ' '; |
| 381 | 381 | } elseif ($this->fields instanceof ArrayObj) { |
@@ -407,23 +407,23 @@ discard block |
||
| 407 | 407 | |
| 408 | 408 | $partition = ''; |
| 409 | 409 | |
| 410 | - if (! empty($this->partitionBy)) { |
|
| 410 | + if (!empty($this->partitionBy)) { |
|
| 411 | 411 | $partition .= "\nPARTITION BY " . $this->partitionBy; |
| 412 | 412 | } |
| 413 | 413 | |
| 414 | - if (! empty($this->partitionsNum)) { |
|
| 414 | + if (!empty($this->partitionsNum)) { |
|
| 415 | 415 | $partition .= "\nPARTITIONS " . $this->partitionsNum; |
| 416 | 416 | } |
| 417 | 417 | |
| 418 | - if (! empty($this->subpartitionBy)) { |
|
| 418 | + if (!empty($this->subpartitionBy)) { |
|
| 419 | 419 | $partition .= "\nSUBPARTITION BY " . $this->subpartitionBy; |
| 420 | 420 | } |
| 421 | 421 | |
| 422 | - if (! empty($this->subpartitionsNum)) { |
|
| 422 | + if (!empty($this->subpartitionsNum)) { |
|
| 423 | 423 | $partition .= "\nSUBPARTITIONS " . $this->subpartitionsNum; |
| 424 | 424 | } |
| 425 | 425 | |
| 426 | - if (! empty($this->partitions)) { |
|
| 426 | + if (!empty($this->partitions)) { |
|
| 427 | 427 | $partition .= "\n" . PartitionDefinition::build($this->partitions); |
| 428 | 428 | } |
| 429 | 429 | |
@@ -492,7 +492,7 @@ discard block |
||
| 492 | 492 | ] |
| 493 | 493 | ); |
| 494 | 494 | |
| 495 | - if (! isset($this->name) || ($this->name === '')) { |
|
| 495 | + if (!isset($this->name) || ($this->name === '')) { |
|
| 496 | 496 | $parser->error( |
| 497 | 497 | 'The name of the entity was expected.', |
| 498 | 498 | $list->tokens[$list->idx] |
@@ -617,7 +617,7 @@ discard block |
||
| 617 | 617 | $token = $list->getNextOfType(Token::TYPE_NUMBER); |
| 618 | 618 | --$list->idx; // `getNextOfType` also advances one position. |
| 619 | 619 | $this->subpartitionsNum = $token->value; |
| 620 | - } elseif (! empty($field)) { |
|
| 620 | + } elseif (!empty($field)) { |
|
| 621 | 621 | /* |
| 622 | 622 | * Handling the content of `PARTITION BY` and `SUBPARTITION BY`. |
| 623 | 623 | */ |
@@ -646,7 +646,7 @@ discard block |
||
| 646 | 646 | $field = null; |
| 647 | 647 | } |
| 648 | 648 | } elseif (($token->type === Token::TYPE_OPERATOR) && ($token->value === '(')) { |
| 649 | - if (! empty($this->partitionBy)) { |
|
| 649 | + if (!empty($this->partitionBy)) { |
|
| 650 | 650 | $this->partitions = ArrayObj::parse( |
| 651 | 651 | $parser, |
| 652 | 652 | $list, |
@@ -27,15 +27,15 @@ |
||
| 27 | 27 | $debug = empty($argv[3]) ? null : rtrim($argv[3], '/'); |
| 28 | 28 | |
| 29 | 29 | // Checking if all directories are valid. |
| 30 | -if (! is_dir($input)) { |
|
| 30 | +if (!is_dir($input)) { |
|
| 31 | 31 | throw new Exception('The input directory does not exist.'); |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | -if (! is_dir($output)) { |
|
| 34 | +if (!is_dir($output)) { |
|
| 35 | 35 | throw new Exception('The output directory does not exist.'); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | -if (($debug !== null) && (! is_dir($debug))) { |
|
| 38 | +if (($debug !== null) && (!is_dir($debug))) { |
|
| 39 | 39 | throw new Exception('The debug directory does not exist.'); |
| 40 | 40 | } |
| 41 | 41 | |
@@ -26,11 +26,11 @@ |
||
| 26 | 26 | $output = rtrim($argv[2], '/'); |
| 27 | 27 | |
| 28 | 28 | // Checking if all directories are valid. |
| 29 | -if (! is_dir($input)) { |
|
| 29 | +if (!is_dir($input)) { |
|
| 30 | 30 | throw new Exception('The input directory does not exist.'); |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | -if (! is_dir($output)) { |
|
| 33 | +if (!is_dir($output)) { |
|
| 34 | 34 | throw new Exception('The output directory does not exist.'); |
| 35 | 35 | } |
| 36 | 36 | |