@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | * |
| 122 | 122 | * @param bool $end whether the end of the buffer was reached |
| 123 | 123 | */ |
| 124 | - public function extract($end = false): string|false |
|
| 124 | + public function extract($end = false): string | false |
|
| 125 | 125 | { |
| 126 | 126 | /** |
| 127 | 127 | * The last parsed position. |
@@ -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 | |
@@ -328,7 +328,7 @@ discard block |
||
| 328 | 328 | |
| 329 | 329 | // Whether this statement should be returned or not. |
| 330 | 330 | $ret = ''; |
| 331 | - if (! empty($this->options['parse_delimiter'])) { |
|
| 331 | + if (!empty($this->options['parse_delimiter'])) { |
|
| 332 | 332 | // Appending the `DELIMITER` statement that was just |
| 333 | 333 | // found to the current statement. |
| 334 | 334 | $ret = trim( |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | $ret = $this->current; |
| 372 | 372 | |
| 373 | 373 | // If needed, adds a delimiter at the end of the statement. |
| 374 | - if (! empty($this->options['add_delimiter'])) { |
|
| 374 | + if (!empty($this->options['add_delimiter'])) { |
|
| 375 | 375 | $ret .= $this->delimiter; |
| 376 | 376 | } |
| 377 | 377 | |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | public static function getForeignKeys($statement): array |
| 25 | 25 | { |
| 26 | - if (empty($statement->fields) || (! is_array($statement->fields)) || (! $statement->options->has('TABLE'))) { |
|
| 26 | + if (empty($statement->fields) || (!is_array($statement->fields)) || (!$statement->options->has('TABLE'))) { |
|
| 27 | 27 | return []; |
| 28 | 28 | } |
| 29 | 29 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | |
| 37 | 37 | $columns = []; |
| 38 | 38 | foreach ($field->key->columns as $column) { |
| 39 | - if (! isset($column['name'])) { |
|
| 39 | + if (!isset($column['name'])) { |
|
| 40 | 40 | continue; |
| 41 | 41 | } |
| 42 | 42 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | 'index_list' => $columns, |
| 49 | 49 | ]; |
| 50 | 50 | |
| 51 | - if (! empty($field->references)) { |
|
| 51 | + if (!empty($field->references)) { |
|
| 52 | 52 | $tmp['ref_db_name'] = $field->references->table->database; |
| 53 | 53 | $tmp['ref_table_name'] = $field->references->table->table; |
| 54 | 54 | $tmp['ref_index_list'] = $field->references->columns; |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | */ |
| 82 | 82 | public static function getFields($statement): array |
| 83 | 83 | { |
| 84 | - if (empty($statement->fields) || (! is_array($statement->fields)) || (! $statement->options->has('TABLE'))) { |
|
| 84 | + if (empty($statement->fields) || (!is_array($statement->fields)) || (!$statement->options->has('TABLE'))) { |
|
| 85 | 85 | return []; |
| 86 | 86 | } |
| 87 | 87 | |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | 'timestamp_not_null' => false, |
| 99 | 99 | ]; |
| 100 | 100 | |
| 101 | - if (! $field->options) { |
|
| 101 | + if (!$field->options) { |
|
| 102 | 102 | continue; |
| 103 | 103 | } |
| 104 | 104 | |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | $option = $field->options->has('AS'); |
| 127 | 127 | |
| 128 | - if (! $option) { |
|
| 128 | + if (!$option) { |
|
| 129 | 129 | continue; |
| 130 | 130 | } |
| 131 | 131 | |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | */ |
| 66 | 66 | public static function gettext($msgid): string |
| 67 | 67 | { |
| 68 | - if (! class_exists(Loader::class, true)) { |
|
| 68 | + if (!class_exists(Loader::class, true)) { |
|
| 69 | 69 | return $msgid; |
| 70 | 70 | } |
| 71 | 71 | |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | * |
| 50 | 50 | * @return ArrayObj|Component[] |
| 51 | 51 | */ |
| 52 | - public static function parse(Parser $parser, TokensList $list, array $options = []): ArrayObj|array |
|
| 52 | + public static function parse(Parser $parser, TokensList $list, array $options = []): ArrayObj | array |
|
| 53 | 53 | { |
| 54 | 54 | $ret = empty($options['type']) ? new static() : []; |
| 55 | 55 | |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | |
| 48 | 48 | public function build(): string |
| 49 | 49 | { |
| 50 | - if (! isset($this->statement)) { |
|
| 50 | + if (!isset($this->statement)) { |
|
| 51 | 51 | throw new RuntimeException('No statement inside WITH'); |
| 52 | 52 | } |
| 53 | 53 | |
@@ -261,7 +261,7 @@ |
||
| 261 | 261 | public function build(): string |
| 262 | 262 | { |
| 263 | 263 | if ($this->dest instanceof Expression) { |
| 264 | - $columns = ! empty($this->columns) ? '(`' . implode('`, `', $this->columns) . '`)' : ''; |
|
| 264 | + $columns = !empty($this->columns) ? '(`' . implode('`, `', $this->columns) . '`)' : ''; |
|
| 265 | 265 | |
| 266 | 266 | return $this->dest . $columns; |
| 267 | 267 | } |
@@ -142,7 +142,7 @@ |
||
| 142 | 142 | public function build(): string |
| 143 | 143 | { |
| 144 | 144 | $tmp = ''; |
| 145 | - if (! empty($this->inOut)) { |
|
| 145 | + if (!empty($this->inOut)) { |
|
| 146 | 146 | $tmp .= $this->inOut . ' '; |
| 147 | 147 | } |
| 148 | 148 | |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | if ($lastOption === null) { |
| 110 | 110 | $upper = strtoupper($token->token); |
| 111 | - if (! isset($options[$upper])) { |
|
| 111 | + if (!isset($options[$upper])) { |
|
| 112 | 112 | // There is no option to be processed. |
| 113 | 113 | break; |
| 114 | 114 | } |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | if ($state === 0) { |
| 148 | - if (! is_array($lastOption)) { |
|
| 148 | + if (!is_array($lastOption)) { |
|
| 149 | 149 | // This is a just keyword option without any value. |
| 150 | 150 | // This is the beginning and the end of it. |
| 151 | 151 | $ret->options[$lastOptionId] = $token->value; |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | $ret->options[$lastOptionId]['expr'] .= $token->token; |
| 223 | 223 | |
| 224 | 224 | if ( |
| 225 | - ! (($token->token === '(') && ($brackets === 1) |
|
| 225 | + !(($token->token === '(') && ($brackets === 1) |
|
| 226 | 226 | || (($token->token === ')') && ($brackets === 0))) |
| 227 | 227 | ) { |
| 228 | 228 | // First pair of brackets is being skipped. |
@@ -274,12 +274,12 @@ discard block |
||
| 274 | 274 | |
| 275 | 275 | $options = []; |
| 276 | 276 | foreach ($this->options as $option) { |
| 277 | - if (! is_array($option)) { |
|
| 277 | + if (!is_array($option)) { |
|
| 278 | 278 | $options[] = $option; |
| 279 | 279 | } else { |
| 280 | 280 | $options[] = $option['name'] |
| 281 | - . (! empty($option['equals']) ? '=' : ' ') |
|
| 282 | - . (! empty($option['expr']) ? $option['expr'] : $option['value']); |
|
| 281 | + . (!empty($option['equals']) ? '=' : ' ') |
|
| 282 | + . (!empty($option['expr']) ? $option['expr'] : $option['value']); |
|
| 283 | 283 | } |
| 284 | 284 | } |
| 285 | 285 | |
@@ -299,10 +299,10 @@ discard block |
||
| 299 | 299 | { |
| 300 | 300 | foreach ($this->options as $option) { |
| 301 | 301 | if (is_array($option)) { |
| 302 | - if (! strcasecmp($key, $option['name'])) { |
|
| 302 | + if (!strcasecmp($key, $option['name'])) { |
|
| 303 | 303 | return $getExpr ? $option['expr'] : $option['value']; |
| 304 | 304 | } |
| 305 | - } elseif (! strcasecmp($key, $option)) { |
|
| 305 | + } elseif (!strcasecmp($key, $option)) { |
|
| 306 | 306 | return true; |
| 307 | 307 | } |
| 308 | 308 | } |
@@ -321,12 +321,12 @@ discard block |
||
| 321 | 321 | { |
| 322 | 322 | foreach ($this->options as $idx => $option) { |
| 323 | 323 | if (is_array($option)) { |
| 324 | - if (! strcasecmp($key, $option['name'])) { |
|
| 324 | + if (!strcasecmp($key, $option['name'])) { |
|
| 325 | 325 | unset($this->options[$idx]); |
| 326 | 326 | |
| 327 | 327 | return true; |
| 328 | 328 | } |
| 329 | - } elseif (! strcasecmp($key, $option)) { |
|
| 329 | + } elseif (!strcasecmp($key, $option)) { |
|
| 330 | 330 | unset($this->options[$idx]); |
| 331 | 331 | |
| 332 | 332 | return true; |
@@ -233,7 +233,7 @@ |
||
| 233 | 233 | return trim( |
| 234 | 234 | 'PARTITION ' . $this->name |
| 235 | 235 | . (empty($this->type) ? '' : ' VALUES ' . $this->type . ' ' . $this->expr . ' ') |
| 236 | - . (! empty($this->options) && ! empty($this->type) ? '' : ' ') |
|
| 236 | + . (!empty($this->options) && !empty($this->type) ? '' : ' ') |
|
| 237 | 237 | . $this->options . $subpartitions |
| 238 | 238 | ); |
| 239 | 239 | } |