Skip to content

Commit 10559a3

Browse files
committed
Tokens: fix up some PHPCS native token values
The PHPCS native token types are normally prefixed with `PHPCS_`. This wasn't the case for the most recent three additions, `T_FN_ARROW` as introduced in PHPCS 3.5.3, `T_TYPE_UNION` and `T_PARAM_NAME` as will be introduced in PHPCS 3.6.0 (not yet released). While the change to the value for `T_FN_ARROW` could be considered a breaking change, it is exceedingly rare for a sniff to use the _value_ of a token constant, so IMO opinion, this is a safe change to make. As for the other two tokens, as they have not been in a release yet, they can be safely updated no matter what.
1 parent 2da6904 commit 10559a3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Util/Tokens.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@
7474
define('T_CLOSE_USE_GROUP', 'PHPCS_T_CLOSE_USE_GROUP');
7575
define('T_ZSR', 'PHPCS_T_ZSR');
7676
define('T_ZSR_EQUAL', 'PHPCS_T_ZSR_EQUAL');
77-
define('T_FN_ARROW', 'T_FN_ARROW');
78-
define('T_TYPE_UNION', 'T_TYPE_UNION');
79-
define('T_PARAM_NAME', 'T_PARAM_NAME');
77+
define('T_FN_ARROW', 'PHPCS_T_FN_ARROW');
78+
define('T_TYPE_UNION', 'PHPCS_T_TYPE_UNION');
79+
define('T_PARAM_NAME', 'PHPCS_T_PARAM_NAME');
8080

8181
// Some PHP 5.5 tokens, replicated for lower versions.
8282
if (defined('T_FINALLY') === false) {

0 commit comments

Comments
 (0)