@@ -18,5 +18,5 @@ |
||
| 18 | 18 | * |
| 19 | 19 | * @return Component|Component[]|null |
| 20 | 20 | */ |
| 21 | - public static function parse(Parser $parser, TokensList $list, array $options = []): Component|array|null; |
|
| 21 | + public static function parse(Parser $parser, TokensList $list, array $options = []): Component | array | null; |
|
| 22 | 22 | } |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | $state = 4; |
| 171 | 171 | } elseif ($token->type === TokenType::Symbol || $token->type === TokenType::None) { |
| 172 | 172 | $expr->name = $token->value; |
| 173 | - if (! $expr->isConstraint) { |
|
| 173 | + if (!$expr->isConstraint) { |
|
| 174 | 174 | $state = 2; |
| 175 | 175 | } |
| 176 | 176 | } elseif ($token->type === TokenType::Keyword) { |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | |
| 212 | 212 | $state = 5; |
| 213 | 213 | } else { |
| 214 | - if (! empty($expr->type) || ! empty($expr->key)) { |
|
| 214 | + if (!empty($expr->type) || !empty($expr->key)) { |
|
| 215 | 215 | $ret[] = $expr; |
| 216 | 216 | } |
| 217 | 217 | |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | // Last iteration was not saved. |
| 234 | - if (! empty($expr->type) || ! empty($expr->key)) { |
|
| 234 | + if (!empty($expr->type) || !empty($expr->key)) { |
|
| 235 | 235 | $ret[] = $expr; |
| 236 | 236 | } |
| 237 | 237 | |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | |
| 88 | 88 | if ($lastOption === null) { |
| 89 | 89 | $upper = strtoupper($token->token); |
| 90 | - if (! isset($options[$upper])) { |
|
| 90 | + if (!isset($options[$upper])) { |
|
| 91 | 91 | // There is no option to be processed. |
| 92 | 92 | break; |
| 93 | 93 | } |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if ($state === 0) { |
| 127 | - if (! is_array($lastOption)) { |
|
| 127 | + if (!is_array($lastOption)) { |
|
| 128 | 128 | // This is a just keyword option without any value. |
| 129 | 129 | // This is the beginning and the end of it. |
| 130 | 130 | $ret->options[$lastOptionId] = $token->value; |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | $ret->options[$lastOptionId]['expr'] .= $token->token; |
| 202 | 202 | |
| 203 | 203 | if ( |
| 204 | - ! (($token->token === '(') && ($brackets === 1) |
|
| 204 | + !(($token->token === '(') && ($brackets === 1) |
|
| 205 | 205 | || (($token->token === ')') && ($brackets === 0))) |
| 206 | 206 | ) { |
| 207 | 207 | // First pair of brackets is being skipped. |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | * |
| 28 | 28 | * @return ArrayObj|Component[] |
| 29 | 29 | */ |
| 30 | - public static function parse(Parser $parser, TokensList $list, array $options = []): ArrayObj|array |
|
| 30 | + public static function parse(Parser $parser, TokensList $list, array $options = []): ArrayObj | array |
|
| 31 | 31 | { |
| 32 | 32 | $ret = empty($options['type']) ? new ArrayObj() : []; |
| 33 | 33 | |
@@ -401,7 +401,7 @@ discard block |
||
| 401 | 401 | } elseif (($token->value === ',') && ($brackets === 0)) { |
| 402 | 402 | break; |
| 403 | 403 | } |
| 404 | - } elseif (! self::checkIfTokenQuotedSymbol($token) && $token->type !== TokenType::String) { |
|
| 404 | + } elseif (!self::checkIfTokenQuotedSymbol($token) && $token->type !== TokenType::String) { |
|
| 405 | 405 | if (isset(Parser::STATEMENT_PARSERS[$arrayKey]) && Parser::STATEMENT_PARSERS[$arrayKey] !== '') { |
| 406 | 406 | $list->idx++; // Ignore the current token |
| 407 | 407 | $nextToken = $list->getNext(); |
@@ -424,7 +424,7 @@ discard block |
||
| 424 | 424 | } elseif ( |
| 425 | 425 | (array_key_exists($arrayKey, self::DATABASE_OPTIONS) |
| 426 | 426 | || array_key_exists($arrayKey, self::TABLE_OPTIONS)) |
| 427 | - && ! self::checkIfColumnDefinitionKeyword($arrayKey) |
|
| 427 | + && !self::checkIfColumnDefinitionKeyword($arrayKey) |
|
| 428 | 428 | ) { |
| 429 | 429 | // This alter operation has finished, which means a comma |
| 430 | 430 | // was missing before start of new alter operation |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | |
| 200 | 200 | // Handle optional AS keyword before alias |
| 201 | 201 | if ($token->type === TokenType::Keyword && $token->keyword === 'AS') { |
| 202 | - if ($asFound || ! empty($ret->alias)) { |
|
| 202 | + if ($asFound || !empty($ret->alias)) { |
|
| 203 | 203 | $parser->error('Potential duplicate alias of CASE expression.', $token); |
| 204 | 204 | break; |
| 205 | 205 | } |
@@ -221,11 +221,11 @@ discard block |
||
| 221 | 221 | if ( |
| 222 | 222 | $asFound |
| 223 | 223 | || $token->type === TokenType::String |
| 224 | - || ($token->type === TokenType::Symbol && ! $token->flags & Token::FLAG_SYMBOL_VARIABLE) |
|
| 224 | + || ($token->type === TokenType::Symbol && !$token->flags & Token::FLAG_SYMBOL_VARIABLE) |
|
| 225 | 225 | || $token->type === TokenType::None |
| 226 | 226 | ) { |
| 227 | 227 | // An alias is expected (the keyword `AS` was previously found). |
| 228 | - if (! empty($ret->alias)) { |
|
| 228 | + if (!empty($ret->alias)) { |
|
| 229 | 229 | $parser->error('An alias was previously found.', $token); |
| 230 | 230 | break; |
| 231 | 231 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | * @param TokensList $list the list of tokens that are being parsed |
| 45 | 45 | * @param array<string, mixed> $options parameters for parsing |
| 46 | 46 | */ |
| 47 | - public static function parse(Parser $parser, TokensList $list, array $options = []): DataType|null |
|
| 47 | + public static function parse(Parser $parser, TokensList $list, array $options = []): DataType | null |
|
| 48 | 48 | { |
| 49 | 49 | $ret = new DataType(); |
| 50 | 50 | |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | if ($state === 0) { |
| 74 | 74 | $ret->name = strtoupper((string) $token->value); |
| 75 | - if (($token->type !== TokenType::Keyword) || (! ($token->flags & Token::FLAG_KEYWORD_DATA_TYPE))) { |
|
| 75 | + if (($token->type !== TokenType::Keyword) || (!($token->flags & Token::FLAG_KEYWORD_DATA_TYPE))) { |
|
| 76 | 76 | $parser->error('Unrecognized data type.', $token); |
| 77 | 77 | } |
| 78 | 78 | |
@@ -156,7 +156,7 @@ |
||
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | // Last iteration was not saved. |
| 159 | - if (! empty($expr->old)) { |
|
| 159 | + if (!empty($expr->old)) { |
|
| 160 | 160 | $ret[] = $expr; |
| 161 | 161 | } |
| 162 | 162 | |
@@ -121,7 +121,7 @@ |
||
| 121 | 121 | } |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | - if (! empty($expr->type)) { |
|
| 124 | + if (!empty($expr->type)) { |
|
| 125 | 125 | $ret[] = $expr; |
| 126 | 126 | } |
| 127 | 127 | |