@@ -75,7 +75,7 @@ |
||
75 | 75 | $this->byteIdx = 0; |
76 | 76 | $this->charIdx = 0; |
77 | 77 | $this->byteLen = mb_strlen($str, '8bit'); |
78 | - if (! mb_check_encoding($str, 'UTF-8')) { |
|
78 | + if (!mb_check_encoding($str, 'UTF-8')) { |
|
79 | 79 | $this->charLen = 0; |
80 | 80 | } else { |
81 | 81 | $this->charLen = mb_strlen($str, 'UTF-8'); |
@@ -95,7 +95,7 @@ |
||
95 | 95 | break; |
96 | 96 | } |
97 | 97 | } elseif ($state === 1) { |
98 | - if (! $this->isLock) { |
|
98 | + if (!$this->isLock) { |
|
99 | 99 | // UNLOCK statement should not have any more tokens |
100 | 100 | $parser->error('Unexpected token.', $token); |
101 | 101 | break; |
@@ -166,25 +166,25 @@ |
||
166 | 166 | { |
167 | 167 | $ret = 'DELETE ' . OptionsArray::build($this->options); |
168 | 168 | |
169 | - if (! is_null($this->columns) && count($this->columns) > 0) { |
|
169 | + if (!is_null($this->columns) && count($this->columns) > 0) { |
|
170 | 170 | $ret .= ' ' . ExpressionArray::build($this->columns); |
171 | 171 | } |
172 | - if (! is_null($this->from) && count($this->from) > 0) { |
|
172 | + if (!is_null($this->from) && count($this->from) > 0) { |
|
173 | 173 | $ret .= ' FROM ' . ExpressionArray::build($this->from); |
174 | 174 | } |
175 | - if (! is_null($this->join) && count($this->join) > 0) { |
|
175 | + if (!is_null($this->join) && count($this->join) > 0) { |
|
176 | 176 | $ret .= ' ' . JoinKeyword::build($this->join); |
177 | 177 | } |
178 | - if (! is_null($this->using) && count($this->using) > 0) { |
|
178 | + if (!is_null($this->using) && count($this->using) > 0) { |
|
179 | 179 | $ret .= ' USING ' . ExpressionArray::build($this->using); |
180 | 180 | } |
181 | - if (! is_null($this->where) && count($this->where) > 0) { |
|
181 | + if (!is_null($this->where) && count($this->where) > 0) { |
|
182 | 182 | $ret .= ' WHERE ' . Condition::build($this->where); |
183 | 183 | } |
184 | - if (! is_null($this->order) && count($this->order) > 0) { |
|
184 | + if (!is_null($this->order) && count($this->order) > 0) { |
|
185 | 185 | $ret .= ' ORDER BY ' . ExpressionArray::build($this->order); |
186 | 186 | } |
187 | - if (! is_null($this->limit) && strlen($this->limit) > 0) { |
|
187 | + if (!is_null($this->limit) && strlen($this->limit) > 0) { |
|
188 | 188 | $ret .= ' LIMIT ' . Limit::build($this->limit); |
189 | 189 | } |
190 | 190 |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | public function build() |
377 | 377 | { |
378 | 378 | $fields = ''; |
379 | - if (! empty($this->fields)) { |
|
379 | + if (!empty($this->fields)) { |
|
380 | 380 | if (is_array($this->fields)) { |
381 | 381 | $fields = CreateDefinition::build($this->fields) . ' '; |
382 | 382 | } elseif ($this->fields instanceof ArrayObj) { |
@@ -389,12 +389,12 @@ discard block |
||
389 | 389 | . Expression::build($this->name) . ' ' |
390 | 390 | . OptionsArray::build($this->entityOptions); |
391 | 391 | } elseif ($this->options->has('TABLE')) { |
392 | - if (! is_null($this->select)) { |
|
392 | + if (!is_null($this->select)) { |
|
393 | 393 | return 'CREATE ' |
394 | 394 | . OptionsArray::build($this->options) . ' ' |
395 | 395 | . Expression::build($this->name) . ' ' |
396 | 396 | . $this->select->build(); |
397 | - } elseif (! is_null($this->like)) { |
|
397 | + } elseif (!is_null($this->like)) { |
|
398 | 398 | return 'CREATE ' |
399 | 399 | . OptionsArray::build($this->options) . ' ' |
400 | 400 | . Expression::build($this->name) . ' LIKE ' |
@@ -402,19 +402,19 @@ 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 | - if (! empty($this->partitionsNum)) { |
|
408 | + if (!empty($this->partitionsNum)) { |
|
409 | 409 | $partition .= "\nPARTITIONS " . $this->partitionsNum; |
410 | 410 | } |
411 | - if (! empty($this->subpartitionBy)) { |
|
411 | + if (!empty($this->subpartitionBy)) { |
|
412 | 412 | $partition .= "\nSUBPARTITION BY " . $this->subpartitionBy; |
413 | 413 | } |
414 | - if (! empty($this->subpartitionsNum)) { |
|
414 | + if (!empty($this->subpartitionsNum)) { |
|
415 | 415 | $partition .= "\nSUBPARTITIONS " . $this->subpartitionsNum; |
416 | 416 | } |
417 | - if (! empty($this->partitions)) { |
|
417 | + if (!empty($this->partitions)) { |
|
418 | 418 | $partition .= "\n" . PartitionDefinition::build($this->partitions); |
419 | 419 | } |
420 | 420 | |
@@ -484,7 +484,7 @@ discard block |
||
484 | 484 | ) |
485 | 485 | ); |
486 | 486 | |
487 | - if (! isset($this->name) || ($this->name === '')) { |
|
487 | + if (!isset($this->name) || ($this->name === '')) { |
|
488 | 488 | $parser->error( |
489 | 489 | 'The name of the entity was expected.', |
490 | 490 | $list->tokens[$list->idx] |
@@ -608,7 +608,7 @@ discard block |
||
608 | 608 | $token = $list->getNextOfType(Token::TYPE_NUMBER); |
609 | 609 | --$list->idx; // `getNextOfType` also advances one position. |
610 | 610 | $this->subpartitionsNum = $token->value; |
611 | - } elseif (! empty($field)) { |
|
611 | + } elseif (!empty($field)) { |
|
612 | 612 | /* |
613 | 613 | * Handling the content of `PARTITION BY` and `SUBPARTITION BY`. |
614 | 614 | */ |
@@ -637,7 +637,7 @@ discard block |
||
637 | 637 | $field = null; |
638 | 638 | } |
639 | 639 | } elseif (($token->type === Token::TYPE_OPERATOR) && ($token->value === '(')) { |
640 | - if (! empty($this->partitionBy)) { |
|
640 | + if (!empty($this->partitionBy)) { |
|
641 | 641 | $this->partitions = ArrayObj::parse( |
642 | 642 | $parser, |
643 | 643 | $list, |
@@ -113,15 +113,15 @@ |
||
113 | 113 | $ret = 'INSERT ' . $this->options; |
114 | 114 | $ret = trim($ret) . ' INTO ' . $this->into; |
115 | 115 | |
116 | - if (! is_null($this->values) && count($this->values) > 0) { |
|
116 | + if (!is_null($this->values) && count($this->values) > 0) { |
|
117 | 117 | $ret .= ' VALUES ' . Array2d::build($this->values); |
118 | - } elseif (! is_null($this->set) && count($this->set) > 0) { |
|
118 | + } elseif (!is_null($this->set) && count($this->set) > 0) { |
|
119 | 119 | $ret .= ' SET ' . SetOperation::build($this->set); |
120 | - } elseif (! is_null($this->select) && strlen($this->select) > 0) { |
|
120 | + } elseif (!is_null($this->select) && strlen($this->select) > 0) { |
|
121 | 121 | $ret .= ' ' . $this->select->build(); |
122 | 122 | } |
123 | 123 | |
124 | - if (! is_null($this->onDuplicateSet) && count($this->onDuplicateSet) > 0) { |
|
124 | + if (!is_null($this->onDuplicateSet) && count($this->onDuplicateSet) > 0) { |
|
125 | 125 | $ret .= ' ON DUPLICATE KEY UPDATE ' . SetOperation::build($this->onDuplicateSet); |
126 | 126 | } |
127 | 127 |
@@ -331,7 +331,7 @@ |
||
331 | 331 | // This is a cheap fix for `SELECT` statements that contain `UNION`. |
332 | 332 | // The `ORDER BY` and `LIMIT` clauses should be at the end of the |
333 | 333 | // statement. |
334 | - if (! empty($this->union)) { |
|
334 | + if (!empty($this->union)) { |
|
335 | 335 | $clauses = static::$CLAUSES; |
336 | 336 | unset($clauses['ORDER BY'], $clauses['LIMIT']); |
337 | 337 | $clauses['ORDER BY'] = array( |
@@ -90,11 +90,11 @@ |
||
90 | 90 | $ret = 'REPLACE ' . $this->options; |
91 | 91 | $ret = trim($ret) . ' INTO ' . $this->into; |
92 | 92 | |
93 | - if (! is_null($this->values) && count($this->values) > 0) { |
|
93 | + if (!is_null($this->values) && count($this->values) > 0) { |
|
94 | 94 | $ret .= ' VALUES ' . Array2d::build($this->values); |
95 | - } elseif (! is_null($this->set) && count($this->set) > 0) { |
|
95 | + } elseif (!is_null($this->set) && count($this->set) > 0) { |
|
96 | 96 | $ret .= ' SET ' . SetOperation::build($this->set); |
97 | - } elseif (! is_null($this->select) && strlen($this->select) > 0) { |
|
97 | + } elseif (!is_null($this->select) && strlen($this->select) > 0) { |
|
98 | 98 | $ret .= ' ' . $this->select->build(); |
99 | 99 | } |
100 | 100 |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | switch ($this->type) { |
243 | 243 | case self::TYPE_KEYWORD: |
244 | 244 | $this->keyword = strtoupper($this->token); |
245 | - if (! ($this->flags & self::FLAG_KEYWORD_RESERVED)) { |
|
245 | + if (!($this->flags & self::FLAG_KEYWORD_RESERVED)) { |
|
246 | 246 | // Unreserved keywords should stay the way they are because they |
247 | 247 | // might represent field names. |
248 | 248 | return $this->token; |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | || ($this->flags & self::FLAG_NUMBER_FLOAT) |
267 | 267 | ) { |
268 | 268 | $ret = (float) $ret; |
269 | - } elseif (! ($this->flags & self::FLAG_NUMBER_BINARY)) { |
|
269 | + } elseif (!($this->flags & self::FLAG_NUMBER_BINARY)) { |
|
270 | 270 | $ret = (int) $ret; |
271 | 271 | } |
272 | 272 | |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | // in PHP 5.3- the `null` parameter isn't handled correctly. |
300 | 300 | $str = mb_substr( |
301 | 301 | $str, |
302 | - (! empty($str[1]) && ($str[1] === '@')) ? 2 : 1, |
|
302 | + (!empty($str[1]) && ($str[1] === '@')) ? 2 : 1, |
|
303 | 303 | mb_strlen($str), |
304 | 304 | 'UTF-8' |
305 | 305 | ); |
@@ -271,11 +271,11 @@ discard block |
||
271 | 271 | } elseif (($token->value === ',') && ($brackets === 0)) { |
272 | 272 | break; |
273 | 273 | } |
274 | - } elseif (! empty(Parser::$STATEMENT_PARSERS[$token->value])) { |
|
274 | + } elseif (!empty(Parser::$STATEMENT_PARSERS[$token->value])) { |
|
275 | 275 | // We have reached the end of ALTER operation and suddenly found |
276 | 276 | // a start to new statement, but have not find a delimiter between them |
277 | 277 | |
278 | - if (! ($token->value === 'SET' && $list->tokens[$list->idx - 1]->value === 'CHARACTER')) { |
|
278 | + if (!($token->value === 'SET' && $list->tokens[$list->idx - 1]->value === 'CHARACTER')) { |
|
279 | 279 | $parser->error( |
280 | 280 | 'A new statement was found, but no delimiter between it and the previous one.', |
281 | 281 | $token |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | } |
285 | 285 | } elseif ((array_key_exists($token->value, self::$DB_OPTIONS) |
286 | 286 | || array_key_exists($token->value, self::$TABLE_OPTIONS)) |
287 | - && ! self::checkIfColumnDefinitionKeyword($token->value) |
|
287 | + && !self::checkIfColumnDefinitionKeyword($token->value) |
|
288 | 288 | ) { |
289 | 289 | // This alter operation has finished, which means a comma was missing before start of new alter operation |
290 | 290 | $parser->error( |