Skip to content

Commit 7c87f95

Browse files
committed
Reorder PHP constants for better maintainability
1 parent f9e71ea commit 7c87f95

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/Util/Tokens.php

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -941,22 +941,29 @@ public static function polyfillTokenizerConstants(): void
941941
// PHP will intitialise the class, leading to warnings about undefined
942942
// T_* constants.
943943
$tokensToPolyfill = [
944-
'T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG',
945-
'T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG',
946-
'T_ATTRIBUTE',
944+
// PHP 7.4 native tokens.
947945
'T_BAD_CHARACTER',
948946
'T_COALESCE_EQUAL',
949-
'T_ENUM',
950947
'T_FN',
948+
949+
// PHP 8.0 native tokens.
950+
'T_ATTRIBUTE',
951951
'T_MATCH',
952952
'T_NAME_FULLY_QUALIFIED',
953953
'T_NAME_QUALIFIED',
954954
'T_NAME_RELATIVE',
955955
'T_NULLSAFE_OBJECT_OPERATOR',
956+
957+
// PHP 8.1 native tokens.
958+
'T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG',
959+
'T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG',
960+
'T_ENUM',
961+
'T_READONLY',
962+
963+
// PHP 8.4 native tokens.
956964
'T_PRIVATE_SET',
957965
'T_PROTECTED_SET',
958966
'T_PUBLIC_SET',
959-
'T_READONLY',
960967
];
961968

962969
// <https://www.php.net/manual/en/tokens.php>

0 commit comments

Comments
 (0)