Skip to content

Commit 14b5822

Browse files
committed
Reorder PHP constants for better maintainability
1 parent 9fcdd17 commit 14b5822

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

src/Util/Tokens.php

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -942,22 +942,32 @@ public static function polyfillTokenizerConstants(): void
942942
// PHP will intitialise the class, leading to warnings about undefined
943943
// T_* constants.
944944
$tokensToPolyfill = [
945-
'T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG',
946-
'T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG',
947-
'T_ATTRIBUTE',
945+
// PHP 7.4 native tokens.
948946
'T_BAD_CHARACTER',
949947
'T_COALESCE_EQUAL',
950-
'T_ENUM',
951948
'T_FN',
949+
950+
// PHP 8.0 native tokens.
951+
'T_ATTRIBUTE',
952952
'T_MATCH',
953953
'T_NAME_FULLY_QUALIFIED',
954954
'T_NAME_QUALIFIED',
955955
'T_NAME_RELATIVE',
956956
'T_NULLSAFE_OBJECT_OPERATOR',
957+
958+
// PHP 8.1 native tokens.
959+
'T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG',
960+
'T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG',
961+
'T_ENUM',
962+
'T_READONLY',
963+
964+
// PHP 8.4 native tokens.
957965
'T_PRIVATE_SET',
958966
'T_PROTECTED_SET',
959967
'T_PUBLIC_SET',
960968
'T_READONLY',
969+
970+
// PHP 8.5 native tokens.
961971
'T_VOID_CAST',
962972
];
963973

0 commit comments

Comments
 (0)