Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -546,11 +546,6 @@
<code>ContextMySql50600</code>
</UnusedClass>
</file>
<file src="src/Contexts/ContextMySql50700.php">
<UnusedClass>
<code>ContextMySql50700</code>
</UnusedClass>
</file>
<file src="src/Contexts/ContextMySql80000.php">
<UnusedClass>
<code>ContextMySql80000</code>
Expand Down
39 changes: 14 additions & 25 deletions src/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

namespace PhpMyAdmin\SqlParser;

use PhpMyAdmin\SqlParser\Contexts\ContextMySql50700;

use function class_exists;
use function explode;
use function in_array;
Expand Down Expand Up @@ -43,27 +45,16 @@ abstract class Context
*/
public const OPERATOR_MAX_LENGTH = 4;

/**
* The name of the default content.
*
* @var string
*/
public static $defaultContext = '\\PhpMyAdmin\\SqlParser\\Contexts\\ContextMySql50700';

/**
* The name of the loaded context.
*
* @var string
*/
public static $loadedContext = '\\PhpMyAdmin\\SqlParser\\Contexts\\ContextMySql50700';
public static string $loadedContext = ContextMySql50700::class;

/**
* The prefix concatenated to the context name when an incomplete class name
* is specified.
*
* @var string
*/
public static $contextPrefix = '\\PhpMyAdmin\\SqlParser\\Contexts\\Context';
public static string $contextPrefix = 'PhpMyAdmin\\SqlParser\\Contexts\\Context';

/**
* List of keywords.
Expand All @@ -83,14 +74,14 @@ abstract class Context
* @psalm-var non-empty-array<string,Token::FLAG_KEYWORD_*|int>
* @phpstan-var non-empty-array<non-empty-string,Token::FLAG_KEYWORD_*|int>
*/
public static $keywords = [];
public static array $keywords = [];

/**
* List of operators and their flags.
*
* @var array<string, int>
*/
public static $operators = [
public static array $operators = [
// Some operators (*, =) may have ambiguous flags, because they depend on
// the context they are being used in.
// For example: 1. SELECT * FROM table; # SQL specific (wildcard)
Expand Down Expand Up @@ -144,10 +135,8 @@ abstract class Context
*
* @link https://dev.mysql.com/doc/refman/en/sql-mode.html
* @link https://mariadb.com/kb/en/sql-mode/
*
* @var int
*/
public static $mode = self::SQL_MODE_NONE;
public static int $mode = self::SQL_MODE_NONE;

public const SQL_MODE_NONE = 0;

Expand Down Expand Up @@ -529,19 +518,19 @@ public static function isSeparator(string $string): bool
*/
public static function load(string $context = ''): bool
{
if (empty($context)) {
$context = self::$defaultContext;
if ($context === '') {
$context = ContextMySql50700::class;
}

if ($context[0] !== '\\') {
if (! class_exists($context)) {
if (! class_exists(self::$contextPrefix . $context)) {
return false;
}

// Short context name (must be formatted into class name).
$context = self::$contextPrefix . $context;
}

if (! class_exists($context)) {
return false;
}

self::$loadedContext = $context;
self::$keywords = $context::$keywords;

Expand Down
2 changes: 1 addition & 1 deletion src/Contexts/ContextMariaDb100000.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ContextMariaDb100000 extends Context
* @psalm-var non-empty-array<string,Token::FLAG_KEYWORD_*|int>
* @phpstan-var non-empty-array<non-empty-string,Token::FLAG_KEYWORD_*|int>
*/
public static $keywords = [
public static array $keywords = [
'AT' => 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1,
'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1,
'ONE' => 1, 'ROW' => 1,
Expand Down
2 changes: 1 addition & 1 deletion src/Contexts/ContextMariaDb100100.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ContextMariaDb100100 extends Context
* @psalm-var non-empty-array<string,Token::FLAG_KEYWORD_*|int>
* @phpstan-var non-empty-array<non-empty-string,Token::FLAG_KEYWORD_*|int>
*/
public static $keywords = [
public static array $keywords = [
'AT' => 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1,
'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1,
'ONE' => 1, 'ROW' => 1, 'XID' => 1,
Expand Down
2 changes: 1 addition & 1 deletion src/Contexts/ContextMariaDb100200.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ContextMariaDb100200 extends Context
* @psalm-var non-empty-array<string,Token::FLAG_KEYWORD_*|int>
* @phpstan-var non-empty-array<non-empty-string,Token::FLAG_KEYWORD_*|int>
*/
public static $keywords = [
public static array $keywords = [
'AT' => 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1,
'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1,
'ONE' => 1, 'ROW' => 1, 'XID' => 1,
Expand Down
2 changes: 1 addition & 1 deletion src/Contexts/ContextMariaDb100300.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ContextMariaDb100300 extends Context
* @psalm-var non-empty-array<string,Token::FLAG_KEYWORD_*|int>
* @phpstan-var non-empty-array<non-empty-string,Token::FLAG_KEYWORD_*|int>
*/
public static $keywords = [
public static array $keywords = [
'AT' => 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1,
'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1,
'ONE' => 1, 'ROW' => 1, 'XID' => 1,
Expand Down
2 changes: 1 addition & 1 deletion src/Contexts/ContextMariaDb100400.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ContextMariaDb100400 extends Context
* @psalm-var non-empty-array<string,Token::FLAG_KEYWORD_*|int>
* @phpstan-var non-empty-array<non-empty-string,Token::FLAG_KEYWORD_*|int>
*/
public static $keywords = [
public static array $keywords = [
'AT' => 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1,
'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1,
'ONE' => 1, 'ROW' => 1, 'XID' => 1,
Expand Down
2 changes: 1 addition & 1 deletion src/Contexts/ContextMariaDb100500.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ContextMariaDb100500 extends Context
* @psalm-var non-empty-array<string,Token::FLAG_KEYWORD_*|int>
* @phpstan-var non-empty-array<non-empty-string,Token::FLAG_KEYWORD_*|int>
*/
public static $keywords = [
public static array $keywords = [
'AT' => 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1,
'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1,
'ONE' => 1, 'ROW' => 1, 'XID' => 1,
Expand Down
2 changes: 1 addition & 1 deletion src/Contexts/ContextMariaDb100600.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ContextMariaDb100600 extends Context
* @psalm-var non-empty-array<string,Token::FLAG_KEYWORD_*|int>
* @phpstan-var non-empty-array<non-empty-string,Token::FLAG_KEYWORD_*|int>
*/
public static $keywords = [
public static array $keywords = [
'AT' => 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1,
'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1,
'ONE' => 1, 'ROW' => 1, 'XID' => 1,
Expand Down
2 changes: 1 addition & 1 deletion src/Contexts/ContextMariaDb100700.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ContextMariaDb100700 extends Context
* @psalm-var non-empty-array<string,Token::FLAG_KEYWORD_*|int>
* @phpstan-var non-empty-array<non-empty-string,Token::FLAG_KEYWORD_*|int>
*/
public static $keywords = [
public static array $keywords = [
'AT' => 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1,
'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1,
'ONE' => 1, 'ROW' => 1, 'XID' => 1,
Expand Down
2 changes: 1 addition & 1 deletion src/Contexts/ContextMariaDb100800.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ContextMariaDb100800 extends Context
* @psalm-var non-empty-array<string,Token::FLAG_KEYWORD_*|int>
* @phpstan-var non-empty-array<non-empty-string,Token::FLAG_KEYWORD_*|int>
*/
public static $keywords = [
public static array $keywords = [
'AT' => 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1,
'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1,
'ONE' => 1, 'ROW' => 1, 'XID' => 1,
Expand Down
2 changes: 1 addition & 1 deletion src/Contexts/ContextMariaDb100900.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ContextMariaDb100900 extends Context
* @psalm-var non-empty-array<string,Token::FLAG_KEYWORD_*|int>
* @phpstan-var non-empty-array<non-empty-string,Token::FLAG_KEYWORD_*|int>
*/
public static $keywords = [
public static array $keywords = [
'AT' => 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1,
'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1,
'ONE' => 1, 'ROW' => 1, 'XID' => 1,
Expand Down
2 changes: 1 addition & 1 deletion src/Contexts/ContextMariaDb101000.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ContextMariaDb101000 extends Context
* @psalm-var non-empty-array<string,Token::FLAG_KEYWORD_*|int>
* @phpstan-var non-empty-array<non-empty-string,Token::FLAG_KEYWORD_*|int>
*/
public static $keywords = [
public static array $keywords = [
'AT' => 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1,
'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1,
'ONE' => 1, 'ROW' => 1, 'XID' => 1,
Expand Down
2 changes: 1 addition & 1 deletion src/Contexts/ContextMariaDb101100.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ContextMariaDb101100 extends Context
* @psalm-var non-empty-array<string,Token::FLAG_KEYWORD_*|int>
* @phpstan-var non-empty-array<non-empty-string,Token::FLAG_KEYWORD_*|int>
*/
public static $keywords = [
public static array $keywords = [
'AT' => 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1,
'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1,
'ONE' => 1, 'ROW' => 1, 'XID' => 1,
Expand Down
2 changes: 1 addition & 1 deletion src/Contexts/ContextMariaDb110000.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ContextMariaDb110000 extends Context
* @psalm-var non-empty-array<string,Token::FLAG_KEYWORD_*|int>
* @phpstan-var non-empty-array<non-empty-string,Token::FLAG_KEYWORD_*|int>
*/
public static $keywords = [
public static array $keywords = [
'AT' => 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1,
'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1,
'ONE' => 1, 'ROW' => 1, 'XID' => 1,
Expand Down
2 changes: 1 addition & 1 deletion src/Contexts/ContextMariaDb110100.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ContextMariaDb110100 extends Context
* @psalm-var non-empty-array<string,Token::FLAG_KEYWORD_*|int>
* @phpstan-var non-empty-array<non-empty-string,Token::FLAG_KEYWORD_*|int>
*/
public static $keywords = [
public static array $keywords = [
'AT' => 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1,
'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1,
'ONE' => 1, 'ROW' => 1, 'XID' => 1,
Expand Down
2 changes: 1 addition & 1 deletion src/Contexts/ContextMariaDb110200.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ContextMariaDb110200 extends Context
* @psalm-var non-empty-array<string,Token::FLAG_KEYWORD_*|int>
* @phpstan-var non-empty-array<non-empty-string,Token::FLAG_KEYWORD_*|int>
*/
public static $keywords = [
public static array $keywords = [
'AT' => 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1,
'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1,
'ONE' => 1, 'ROW' => 1, 'XID' => 1,
Expand Down
2 changes: 1 addition & 1 deletion src/Contexts/ContextMySql50000.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ContextMySql50000 extends Context
* @psalm-var non-empty-array<string,Token::FLAG_KEYWORD_*|int>
* @phpstan-var non-empty-array<non-empty-string,Token::FLAG_KEYWORD_*|int>
*/
public static $keywords = [
public static array $keywords = [
'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1,
'ANY' => 1, 'BDB' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1,
'NEW' => 1, 'ONE' => 1, 'ROW' => 1,
Expand Down
2 changes: 1 addition & 1 deletion src/Contexts/ContextMySql50100.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ContextMySql50100 extends Context
* @psalm-var non-empty-array<string,Token::FLAG_KEYWORD_*|int>
* @phpstan-var non-empty-array<non-empty-string,Token::FLAG_KEYWORD_*|int>
*/
public static $keywords = [
public static array $keywords = [
'AT' => 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1,
'ANY' => 1, 'BDB' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1,
'NEW' => 1, 'ONE' => 1, 'ROW' => 1,
Expand Down
2 changes: 1 addition & 1 deletion src/Contexts/ContextMySql50500.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ContextMySql50500 extends Context
* @psalm-var non-empty-array<string,Token::FLAG_KEYWORD_*|int>
* @phpstan-var non-empty-array<non-empty-string,Token::FLAG_KEYWORD_*|int>
*/
public static $keywords = [
public static array $keywords = [
'AT' => 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1,
'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1,
'ONE' => 1, 'ROW' => 1,
Expand Down
2 changes: 1 addition & 1 deletion src/Contexts/ContextMySql50600.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ContextMySql50600 extends Context
* @psalm-var non-empty-array<string,Token::FLAG_KEYWORD_*|int>
* @phpstan-var non-empty-array<non-empty-string,Token::FLAG_KEYWORD_*|int>
*/
public static $keywords = [
public static array $keywords = [
'AT' => 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1,
'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1,
'ONE' => 1, 'ROW' => 1,
Expand Down
2 changes: 1 addition & 1 deletion src/Contexts/ContextMySql50700.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ContextMySql50700 extends Context
* @psalm-var non-empty-array<string,Token::FLAG_KEYWORD_*|int>
* @phpstan-var non-empty-array<non-empty-string,Token::FLAG_KEYWORD_*|int>
*/
public static $keywords = [
public static array $keywords = [
'AT' => 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1,
'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1,
'ONE' => 1, 'ROW' => 1, 'XID' => 1,
Expand Down
2 changes: 1 addition & 1 deletion src/Contexts/ContextMySql80000.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ContextMySql80000 extends Context
* @psalm-var non-empty-array<string,Token::FLAG_KEYWORD_*|int>
* @phpstan-var non-empty-array<non-empty-string,Token::FLAG_KEYWORD_*|int>
*/
public static $keywords = [
public static array $keywords = [
'AT' => 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1,
'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1,
'ONE' => 1, 'ROW' => 1, 'XID' => 1,
Expand Down
2 changes: 1 addition & 1 deletion src/Contexts/ContextMySql80100.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ContextMySql80100 extends Context
* @psalm-var non-empty-array<string,Token::FLAG_KEYWORD_*|int>
* @phpstan-var non-empty-array<non-empty-string,Token::FLAG_KEYWORD_*|int>
*/
public static $keywords = [
public static array $keywords = [
'AT' => 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1,
'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1,
'ONE' => 1, 'ROW' => 1, 'XID' => 1,
Expand Down
6 changes: 3 additions & 3 deletions src/Tools/ContextGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class ContextGenerator
*
* @var array<string, int>
*/
public static $labelsFlags = [
public static array $labelsFlags = [
'(R)' => 2, // reserved
'(D)' => 8, // data type
'(K)' => 16, // keyword
Expand All @@ -54,7 +54,7 @@ class ContextGenerator
*
* @var array<string, string>
*/
public static $links = [
public static array $links = [
'MySql50000' => 'https://dev.mysql.com/doc/refman/5.0/en/keywords.html',
'MySql50100' => 'https://dev.mysql.com/doc/refman/5.1/en/keywords.html',
'MySql50500' => 'https://dev.mysql.com/doc/refman/5.5/en/keywords.html',
Expand Down Expand Up @@ -121,7 +121,7 @@ class %2$s extends Context
* @psalm-var non-empty-array<string,Token::FLAG_KEYWORD_*|int>
* @phpstan-var non-empty-array<non-empty-string,Token::FLAG_KEYWORD_*|int>
*/
public static $keywords = [
public static array $keywords = [
%4$s ];
}

Expand Down
2 changes: 1 addition & 1 deletion src/Tools/TestGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public static function build(
Context::load('MariaDb' . $mariaDbVersion);
} else {
// Load the default context to be sure there is no side effects
Context::load('');
Context::load();
}

$test = static::generate($query, $type);
Expand Down
13 changes: 6 additions & 7 deletions tests/Lexer/ContextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,12 @@ public static function tearDownAfterClass(): void
public function testLoad(): void
{
// Default context is 5.7.0.
$this->assertEquals('\\PhpMyAdmin\\SqlParser\\Contexts\\ContextMySql50700', Context::$loadedContext);
$this->assertEquals('PhpMyAdmin\\SqlParser\\Contexts\\ContextMySql50700', Context::$loadedContext);
$this->assertArrayHasKey('STORED', Context::$keywords);
$this->assertArrayNotHasKey('AUTHORS', Context::$keywords);

// Restoring context.
Context::load('');
$this->assertEquals('\\PhpMyAdmin\\SqlParser\\Contexts\\ContextMySql50700', Context::$defaultContext);
Context::load();
$this->assertArrayHasKey('STORED', Context::$keywords);
$this->assertArrayNotHasKey('AUTHORS', Context::$keywords);
}
Expand All @@ -39,12 +38,12 @@ public function testLoadClosest(string $context, string|null $expected): void
{
$this->assertEquals($expected, Context::loadClosest($context));
if ($expected !== null) {
$this->assertEquals('\\PhpMyAdmin\\SqlParser\\Contexts\\Context' . $expected, Context::$loadedContext);
$this->assertEquals('PhpMyAdmin\\SqlParser\\Contexts\\Context' . $expected, Context::$loadedContext);
$this->assertTrue(class_exists(Context::$loadedContext));
}

// Restoring context.
Context::load('');
Context::load();
}

/**
Expand Down Expand Up @@ -89,10 +88,10 @@ public static function contextLoadingProvider(): array
public function testLoadAll(string $context): void
{
Context::load($context);
$this->assertEquals('\\PhpMyAdmin\\SqlParser\\Contexts\\Context' . $context, Context::$loadedContext);
$this->assertEquals('PhpMyAdmin\\SqlParser\\Contexts\\Context' . $context, Context::$loadedContext);

// Restoring context.
Context::load('');
Context::load();
}

/** @return string[][] */
Expand Down
2 changes: 1 addition & 1 deletion tests/Tools/templates/TestContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class TestContext extends Context
* @psalm-var non-empty-array<string,Token::FLAG_KEYWORD_*|int>
* @phpstan-var non-empty-array<non-empty-string,Token::FLAG_KEYWORD_*|int>
*/
public static $keywords = [
public static array $keywords = [
'NO_FLAG' => 1,

'RESERVED' => 3,
Expand Down