|
11 | 11 |
|
12 | 12 | use function array_key_exists; |
13 | 13 | use function in_array; |
14 | | -use function is_numeric; |
| 14 | +use function is_int; |
15 | 15 | use function is_string; |
16 | 16 | use function trim; |
17 | 17 |
|
@@ -300,10 +300,8 @@ public function __construct( |
300 | 300 | * @param Parser $parser the parser that serves as context |
301 | 301 | * @param TokensList $list the list of tokens that are being parsed |
302 | 302 | * @param array<string, mixed> $options parameters for parsing |
303 | | - * |
304 | | - * @return AlterOperation |
305 | 303 | */ |
306 | | - public static function parse(Parser $parser, TokensList $list, array $options = []) |
| 304 | + public static function parse(Parser $parser, TokensList $list, array $options = []): AlterOperation |
307 | 305 | { |
308 | 306 | $ret = new static(); |
309 | 307 |
|
@@ -410,7 +408,7 @@ public static function parse(Parser $parser, TokensList $list, array $options = |
410 | 408 |
|
411 | 409 | $state = 2; |
412 | 410 | } elseif ($state === 2) { |
413 | | - if (is_string($token->value) || is_numeric($token->value)) { |
| 411 | + if (is_string($token->value) || is_int($token->value)) { |
414 | 412 | $arrayKey = $token->value; |
415 | 413 | } else { |
416 | 414 | $arrayKey = $token->token; |
@@ -443,7 +441,7 @@ public static function parse(Parser $parser, TokensList $list, array $options = |
443 | 441 | ); |
444 | 442 | break; |
445 | 443 | } |
446 | | - } elseif (! empty(Parser::$statementParsers[$token->value])) { |
| 444 | + } elseif (! empty(Parser::$statementParsers[$arrayKey])) { |
447 | 445 | // We have reached the end of ALTER operation and suddenly found |
448 | 446 | // a start to new statement, but have not found a delimiter between them |
449 | 447 | $parser->error( |
|
0 commit comments