Skip to content

Commit 3247f64

Browse files
committed
Native property types in Context
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
1 parent 94f2db2 commit 3247f64

25 files changed

Lines changed: 32 additions & 40 deletions

src/Context.php

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,25 +45,19 @@ abstract class Context
4545

4646
/**
4747
* The name of the default content.
48-
*
49-
* @var string
5048
*/
51-
public static $defaultContext = '\\PhpMyAdmin\\SqlParser\\Contexts\\ContextMySql50700';
49+
public static string $defaultContext = '\\PhpMyAdmin\\SqlParser\\Contexts\\ContextMySql50700';
5250

5351
/**
5452
* The name of the loaded context.
55-
*
56-
* @var string
5753
*/
58-
public static $loadedContext = '\\PhpMyAdmin\\SqlParser\\Contexts\\ContextMySql50700';
54+
public static string $loadedContext = '\\PhpMyAdmin\\SqlParser\\Contexts\\ContextMySql50700';
5955

6056
/**
6157
* The prefix concatenated to the context name when an incomplete class name
6258
* is specified.
63-
*
64-
* @var string
6559
*/
66-
public static $contextPrefix = '\\PhpMyAdmin\\SqlParser\\Contexts\\Context';
60+
public static string $contextPrefix = '\\PhpMyAdmin\\SqlParser\\Contexts\\Context';
6761

6862
/**
6963
* List of keywords.
@@ -83,14 +77,14 @@ abstract class Context
8377
* @psalm-var non-empty-array<string,Token::FLAG_KEYWORD_*|int>
8478
* @phpstan-var non-empty-array<non-empty-string,Token::FLAG_KEYWORD_*|int>
8579
*/
86-
public static $keywords = [];
80+
public static array $keywords = [];
8781

8882
/**
8983
* List of operators and their flags.
9084
*
9185
* @var array<string, int>
9286
*/
93-
public static $operators = [
87+
public static array $operators = [
9488
// Some operators (*, =) may have ambiguous flags, because they depend on
9589
// the context they are being used in.
9690
// For example: 1. SELECT * FROM table; # SQL specific (wildcard)
@@ -144,10 +138,8 @@ abstract class Context
144138
*
145139
* @link https://dev.mysql.com/doc/refman/en/sql-mode.html
146140
* @link https://mariadb.com/kb/en/sql-mode/
147-
*
148-
* @var int
149141
*/
150-
public static $mode = self::SQL_MODE_NONE;
142+
public static int $mode = self::SQL_MODE_NONE;
151143

152144
public const SQL_MODE_NONE = 0;
153145

src/Contexts/ContextMariaDb100000.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class ContextMariaDb100000 extends Context
3030
* @psalm-var non-empty-array<string,Token::FLAG_KEYWORD_*|int>
3131
* @phpstan-var non-empty-array<non-empty-string,Token::FLAG_KEYWORD_*|int>
3232
*/
33-
public static $keywords = [
33+
public static array $keywords = [
3434
'AT' => 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1,
3535
'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1,
3636
'ONE' => 1, 'ROW' => 1,

src/Contexts/ContextMariaDb100100.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class ContextMariaDb100100 extends Context
3030
* @psalm-var non-empty-array<string,Token::FLAG_KEYWORD_*|int>
3131
* @phpstan-var non-empty-array<non-empty-string,Token::FLAG_KEYWORD_*|int>
3232
*/
33-
public static $keywords = [
33+
public static array $keywords = [
3434
'AT' => 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1,
3535
'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1,
3636
'ONE' => 1, 'ROW' => 1, 'XID' => 1,

src/Contexts/ContextMariaDb100200.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class ContextMariaDb100200 extends Context
3030
* @psalm-var non-empty-array<string,Token::FLAG_KEYWORD_*|int>
3131
* @phpstan-var non-empty-array<non-empty-string,Token::FLAG_KEYWORD_*|int>
3232
*/
33-
public static $keywords = [
33+
public static array $keywords = [
3434
'AT' => 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1,
3535
'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1,
3636
'ONE' => 1, 'ROW' => 1, 'XID' => 1,

src/Contexts/ContextMariaDb100300.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class ContextMariaDb100300 extends Context
3030
* @psalm-var non-empty-array<string,Token::FLAG_KEYWORD_*|int>
3131
* @phpstan-var non-empty-array<non-empty-string,Token::FLAG_KEYWORD_*|int>
3232
*/
33-
public static $keywords = [
33+
public static array $keywords = [
3434
'AT' => 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1,
3535
'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1,
3636
'ONE' => 1, 'ROW' => 1, 'XID' => 1,

src/Contexts/ContextMariaDb100400.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class ContextMariaDb100400 extends Context
3030
* @psalm-var non-empty-array<string,Token::FLAG_KEYWORD_*|int>
3131
* @phpstan-var non-empty-array<non-empty-string,Token::FLAG_KEYWORD_*|int>
3232
*/
33-
public static $keywords = [
33+
public static array $keywords = [
3434
'AT' => 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1,
3535
'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1,
3636
'ONE' => 1, 'ROW' => 1, 'XID' => 1,

src/Contexts/ContextMariaDb100500.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class ContextMariaDb100500 extends Context
3030
* @psalm-var non-empty-array<string,Token::FLAG_KEYWORD_*|int>
3131
* @phpstan-var non-empty-array<non-empty-string,Token::FLAG_KEYWORD_*|int>
3232
*/
33-
public static $keywords = [
33+
public static array $keywords = [
3434
'AT' => 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1,
3535
'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1,
3636
'ONE' => 1, 'ROW' => 1, 'XID' => 1,

src/Contexts/ContextMariaDb100600.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class ContextMariaDb100600 extends Context
3030
* @psalm-var non-empty-array<string,Token::FLAG_KEYWORD_*|int>
3131
* @phpstan-var non-empty-array<non-empty-string,Token::FLAG_KEYWORD_*|int>
3232
*/
33-
public static $keywords = [
33+
public static array $keywords = [
3434
'AT' => 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1,
3535
'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1,
3636
'ONE' => 1, 'ROW' => 1, 'XID' => 1,

src/Contexts/ContextMariaDb100700.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class ContextMariaDb100700 extends Context
3030
* @psalm-var non-empty-array<string,Token::FLAG_KEYWORD_*|int>
3131
* @phpstan-var non-empty-array<non-empty-string,Token::FLAG_KEYWORD_*|int>
3232
*/
33-
public static $keywords = [
33+
public static array $keywords = [
3434
'AT' => 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1,
3535
'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1,
3636
'ONE' => 1, 'ROW' => 1, 'XID' => 1,

src/Contexts/ContextMariaDb100800.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class ContextMariaDb100800 extends Context
3030
* @psalm-var non-empty-array<string,Token::FLAG_KEYWORD_*|int>
3131
* @phpstan-var non-empty-array<non-empty-string,Token::FLAG_KEYWORD_*|int>
3232
*/
33-
public static $keywords = [
33+
public static array $keywords = [
3434
'AT' => 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1,
3535
'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1,
3636
'ONE' => 1, 'ROW' => 1, 'XID' => 1,

0 commit comments

Comments
 (0)