Skip to content

Commit ce86c62

Browse files
committed
Use OrderSortKeyword in GroupKeyword
Signed-off-by: Kamil Tekiela <[email protected]>
1 parent 913804c commit ce86c62

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Components/GroupKeyword.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
*/
1414
final class GroupKeyword implements Component
1515
{
16-
/** @var 'ASC'|'DESC'|null */
17-
public string|null $type = null;
16+
public OrderSortKeyword|null $type = null;
1817

1918
/**
2019
* The expression that is used for grouping.

src/Parsers/GroupKeywords.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace PhpMyAdmin\SqlParser\Parsers;
66

77
use PhpMyAdmin\SqlParser\Components\GroupKeyword;
8+
use PhpMyAdmin\SqlParser\Components\OrderSortKeyword;
89
use PhpMyAdmin\SqlParser\Parseable;
910
use PhpMyAdmin\SqlParser\Parser;
1011
use PhpMyAdmin\SqlParser\TokensList;
@@ -66,7 +67,7 @@ public static function parse(Parser $parser, TokensList $list, array $options =
6667
($token->type === TokenType::Keyword)
6768
&& (($token->keyword === 'ASC') || ($token->keyword === 'DESC'))
6869
) {
69-
$expr->type = $token->keyword;
70+
$expr->type = OrderSortKeyword::from($token->keyword);
7071
} elseif (($token->type === TokenType::Operator) && ($token->value === ',')) {
7172
if (! empty($expr->expr)) {
7273
$ret[] = $expr;

0 commit comments

Comments
 (0)