@@ -328,7 +328,7 @@ |
||
| 328 | 328 | // This is a cheap fix for `SELECT` statements that contain `UNION`. |
| 329 | 329 | // The `ORDER BY` and `LIMIT` clauses should be at the end of the |
| 330 | 330 | // statement. |
| 331 | - if (! empty($this->union)) { |
|
| 331 | + if (!empty($this->union)) { |
|
| 332 | 332 | $clauses = static::$CLAUSES; |
| 333 | 333 | unset($clauses['ORDER BY'], $clauses['LIMIT']); |
| 334 | 334 | $clauses['ORDER BY'] = [ |
@@ -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) { |
@@ -402,23 +402,23 @@ discard block |
||
| 402 | 402 | } else { |
| 403 | 403 | $partition = ''; |
| 404 | 404 | |
| 405 | - if (! empty($this->partitionBy)) { |
|
| 405 | + if (!empty($this->partitionBy)) { |
|
| 406 | 406 | $partition .= "\nPARTITION BY " . $this->partitionBy; |
| 407 | 407 | } |
| 408 | 408 | |
| 409 | - if (! empty($this->partitionsNum)) { |
|
| 409 | + if (!empty($this->partitionsNum)) { |
|
| 410 | 410 | $partition .= "\nPARTITIONS " . $this->partitionsNum; |
| 411 | 411 | } |
| 412 | 412 | |
| 413 | - if (! empty($this->subpartitionBy)) { |
|
| 413 | + if (!empty($this->subpartitionBy)) { |
|
| 414 | 414 | $partition .= "\nSUBPARTITION BY " . $this->subpartitionBy; |
| 415 | 415 | } |
| 416 | 416 | |
| 417 | - if (! empty($this->subpartitionsNum)) { |
|
| 417 | + if (!empty($this->subpartitionsNum)) { |
|
| 418 | 418 | $partition .= "\nSUBPARTITIONS " . $this->subpartitionsNum; |
| 419 | 419 | } |
| 420 | 420 | |
| 421 | - if (! empty($this->partitions)) { |
|
| 421 | + if (!empty($this->partitions)) { |
|
| 422 | 422 | $partition .= "\n" . PartitionDefinition::build($this->partitions); |
| 423 | 423 | } |
| 424 | 424 | |
@@ -488,7 +488,7 @@ discard block |
||
| 488 | 488 | ] |
| 489 | 489 | ); |
| 490 | 490 | |
| 491 | - if (! isset($this->name) || ($this->name === '')) { |
|
| 491 | + if (!isset($this->name) || ($this->name === '')) { |
|
| 492 | 492 | $parser->error( |
| 493 | 493 | 'The name of the entity was expected.', |
| 494 | 494 | $list->tokens[$list->idx] |
@@ -613,7 +613,7 @@ discard block |
||
| 613 | 613 | $token = $list->getNextOfType(Token::TYPE_NUMBER); |
| 614 | 614 | --$list->idx; // `getNextOfType` also advances one position. |
| 615 | 615 | $this->subpartitionsNum = $token->value; |
| 616 | - } elseif (! empty($field)) { |
|
| 616 | + } elseif (!empty($field)) { |
|
| 617 | 617 | /* |
| 618 | 618 | * Handling the content of `PARTITION BY` and `SUBPARTITION BY`. |
| 619 | 619 | */ |
@@ -642,7 +642,7 @@ discard block |
||
| 642 | 642 | $field = null; |
| 643 | 643 | } |
| 644 | 644 | } elseif (($token->type === Token::TYPE_OPERATOR) && ($token->value === '(')) { |
| 645 | - if (! empty($this->partitionBy)) { |
|
| 645 | + if (!empty($this->partitionBy)) { |
|
| 646 | 646 | $this->partitions = ArrayObj::parse( |
| 647 | 647 | $parser, |
| 648 | 648 | $list, |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | switch ($this->type) { |
| 223 | 223 | case self::TYPE_KEYWORD: |
| 224 | 224 | $this->keyword = strtoupper($this->token); |
| 225 | - if (! ($this->flags & self::FLAG_KEYWORD_RESERVED)) { |
|
| 225 | + if (!($this->flags & self::FLAG_KEYWORD_RESERVED)) { |
|
| 226 | 226 | // Unreserved keywords should stay the way they are because they |
| 227 | 227 | // might represent field names. |
| 228 | 228 | return $this->token; |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | || ($this->flags & self::FLAG_NUMBER_FLOAT) |
| 247 | 247 | ) { |
| 248 | 248 | $ret = (float) $ret; |
| 249 | - } elseif (! ($this->flags & self::FLAG_NUMBER_BINARY)) { |
|
| 249 | + } elseif (!($this->flags & self::FLAG_NUMBER_BINARY)) { |
|
| 250 | 250 | $ret = (int) $ret; |
| 251 | 251 | } |
| 252 | 252 | |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | // in PHP 5.3- the `null` parameter isn't handled correctly. |
| 280 | 280 | $str = mb_substr( |
| 281 | 281 | $str, |
| 282 | - ! empty($str[1]) && ($str[1] === '@') ? 2 : 1, |
|
| 282 | + !empty($str[1]) && ($str[1] === '@') ? 2 : 1, |
|
| 283 | 283 | mb_strlen($str), |
| 284 | 284 | 'UTF-8' |
| 285 | 285 | ); |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | $str = strtoupper($str); |
| 278 | 278 | |
| 279 | 279 | if (isset(static::$KEYWORDS[$str])) { |
| 280 | - if ($isReserved && ! (static::$KEYWORDS[$str] & Token::FLAG_KEYWORD_RESERVED)) { |
|
| 280 | + if ($isReserved && !(static::$KEYWORDS[$str] & Token::FLAG_KEYWORD_RESERVED)) { |
|
| 281 | 281 | return null; |
| 282 | 282 | } |
| 283 | 283 | |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | */ |
| 300 | 300 | public static function isOperator($str) |
| 301 | 301 | { |
| 302 | - if (! isset(static::$OPERATORS[$str])) { |
|
| 302 | + if (!isset(static::$OPERATORS[$str])) { |
|
| 303 | 303 | return null; |
| 304 | 304 | } |
| 305 | 305 | |
@@ -501,7 +501,7 @@ discard block |
||
| 501 | 501 | $context = self::$contextPrefix . $context; |
| 502 | 502 | } |
| 503 | 503 | |
| 504 | - if (! class_exists($context)) { |
|
| 504 | + if (!class_exists($context)) { |
|
| 505 | 505 | throw @new LoaderException( |
| 506 | 506 | 'Specified context ("' . $context . '") does not exist.', |
| 507 | 507 | $context |
@@ -540,7 +540,7 @@ discard block |
||
| 540 | 540 | $i -= 2; |
| 541 | 541 | $part = substr($context, $i, 2); |
| 542 | 542 | /* No more numeric parts to strip */ |
| 543 | - if (! is_numeric($part)) { |
|
| 543 | + if (!is_numeric($part)) { |
|
| 544 | 544 | break 2; |
| 545 | 545 | } |
| 546 | 546 | } while (intval($part) === 0 && $i > 0); |
@@ -596,7 +596,7 @@ discard block |
||
| 596 | 596 | } |
| 597 | 597 | |
| 598 | 598 | if ((static::$MODE & self::SQL_MODE_NO_ENCLOSING_QUOTES) |
| 599 | - && (! static::isKeyword($str, true)) |
|
| 599 | + && (!static::isKeyword($str, true)) |
|
| 600 | 600 | ) { |
| 601 | 601 | return $str; |
| 602 | 602 | } |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | */ |
| 45 | 45 | public function __construct(array $tokens = [], $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); |
@@ -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; |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | |
| 230 | 230 | $ret->options[$lastOptionId]['expr'] .= $token->token; |
| 231 | 231 | |
| 232 | - if (! (($token->token === '(') && ($brackets === 1) |
|
| 232 | + if (!(($token->token === '(') && ($brackets === 1) |
|
| 233 | 233 | || (($token->token === ')') && ($brackets === 0))) |
| 234 | 234 | ) { |
| 235 | 235 | // First pair of brackets is being skipped. |
@@ -287,12 +287,12 @@ discard block |
||
| 287 | 287 | |
| 288 | 288 | $options = []; |
| 289 | 289 | foreach ($component->options as $option) { |
| 290 | - if (! is_array($option)) { |
|
| 290 | + if (!is_array($option)) { |
|
| 291 | 291 | $options[] = $option; |
| 292 | 292 | } else { |
| 293 | 293 | $options[] = $option['name'] |
| 294 | - . (! empty($option['equals']) && $option['equals'] ? '=' : ' ') |
|
| 295 | - . (! empty($option['expr']) ? $option['expr'] : $option['value']); |
|
| 294 | + . (!empty($option['equals']) && $option['equals'] ? '=' : ' ') |
|
| 295 | + . (!empty($option['expr']) ? $option['expr'] : $option['value']); |
|
| 296 | 296 | } |
| 297 | 297 | } |
| 298 | 298 | |
@@ -312,10 +312,10 @@ discard block |
||
| 312 | 312 | { |
| 313 | 313 | foreach ($this->options as $option) { |
| 314 | 314 | if (is_array($option)) { |
| 315 | - if (! strcasecmp($key, $option['name'])) { |
|
| 315 | + if (!strcasecmp($key, $option['name'])) { |
|
| 316 | 316 | return $getExpr ? $option['expr'] : $option['value']; |
| 317 | 317 | } |
| 318 | - } elseif (! strcasecmp($key, $option)) { |
|
| 318 | + } elseif (!strcasecmp($key, $option)) { |
|
| 319 | 319 | return true; |
| 320 | 320 | } |
| 321 | 321 | } |
@@ -334,12 +334,12 @@ discard block |
||
| 334 | 334 | { |
| 335 | 335 | foreach ($this->options as $idx => $option) { |
| 336 | 336 | if (is_array($option)) { |
| 337 | - if (! strcasecmp($key, $option['name'])) { |
|
| 337 | + if (!strcasecmp($key, $option['name'])) { |
|
| 338 | 338 | unset($this->options[$idx]); |
| 339 | 339 | |
| 340 | 340 | return true; |
| 341 | 341 | } |
| 342 | - } elseif (! strcasecmp($key, $option)) { |
|
| 342 | + } elseif (!strcasecmp($key, $option)) { |
|
| 343 | 343 | unset($this->options[$idx]); |
| 344 | 344 | |
| 345 | 345 | return true; |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | $state = 3; |
| 160 | 160 | } elseif (($token->value === ',') || ($token->value === ')')) { |
| 161 | 161 | $state = $token->value === ',' ? 2 : 4; |
| 162 | - if (! empty($lastColumn)) { |
|
| 162 | + if (!empty($lastColumn)) { |
|
| 163 | 163 | $ret->columns[] = $lastColumn; |
| 164 | 164 | $lastColumn = []; |
| 165 | 165 | } |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | public static function build($component, array $options = []) |
| 195 | 195 | { |
| 196 | 196 | $ret = $component->type . ' '; |
| 197 | - if (! empty($component->name)) { |
|
| 197 | + if (!empty($component->name)) { |
|
| 198 | 198 | $ret .= Context::escape($component->name) . ' '; |
| 199 | 199 | } |
| 200 | 200 | |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | |
| 149 | 149 | if ($state === 0) { |
| 150 | 150 | if (($token->type === Token::TYPE_KEYWORD) |
| 151 | - && ! empty(static::$JOINS[$token->keyword]) |
|
| 151 | + && !empty(static::$JOINS[$token->keyword]) |
|
| 152 | 152 | ) { |
| 153 | 153 | $expr->type = static::$JOINS[$token->keyword]; |
| 154 | 154 | $state = 1; |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | $state = 4; |
| 169 | 169 | break; |
| 170 | 170 | default: |
| 171 | - if (! empty(static::$JOINS[$token->keyword]) |
|
| 171 | + if (!empty(static::$JOINS[$token->keyword]) |
|
| 172 | 172 | ) { |
| 173 | 173 | $ret[] = $expr; |
| 174 | 174 | $expr = new static(); |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | } |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | - if (! empty($expr->type)) { |
|
| 198 | + if (!empty($expr->type)) { |
|
| 199 | 199 | $ret[] = $expr; |
| 200 | 200 | } |
| 201 | 201 | |
@@ -215,9 +215,9 @@ discard block |
||
| 215 | 215 | $ret = []; |
| 216 | 216 | foreach ($component as $c) { |
| 217 | 217 | $ret[] = array_search($c->type, static::$JOINS) . ' ' . $c->expr |
| 218 | - . (! empty($c->on) |
|
| 218 | + . (!empty($c->on) |
|
| 219 | 219 | ? ' ON ' . Condition::build($c->on) : '') |
| 220 | - . (! empty($c->using) |
|
| 220 | + . (!empty($c->using) |
|
| 221 | 221 | ? ' USING ' . ArrayObj::build($c->using) : ''); |
| 222 | 222 | } |
| 223 | 223 | |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | |
| 128 | 128 | if ($state === 0) { |
| 129 | 129 | $ret->name = strtoupper((string) $token->value); |
| 130 | - if (($token->type !== Token::TYPE_KEYWORD) || (! ($token->flags & Token::FLAG_KEYWORD_DATA_TYPE))) { |
|
| 130 | + if (($token->type !== Token::TYPE_KEYWORD) || (!($token->flags & Token::FLAG_KEYWORD_DATA_TYPE))) { |
|
| 131 | 131 | $parser->error('Unrecognized data type.', $token); |
| 132 | 132 | } |
| 133 | 133 | |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | $component->name : strtolower($component->name); |
| 168 | 168 | |
| 169 | 169 | $parameters = ''; |
| 170 | - if (! empty($component->parameters)) { |
|
| 170 | + if (!empty($component->parameters)) { |
|
| 171 | 171 | $parameters = '(' . implode(',', $component->parameters) . ')'; |
| 172 | 172 | } |
| 173 | 173 | |