Skip to content

Commit

Permalink
Tokens: fix up some PHPCS native token values
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jrfnl committed Feb 13, 2021
1 parent 2da6904 commit 10559a3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Util/Tokens.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@
define('T_CLOSE_USE_GROUP', 'PHPCS_T_CLOSE_USE_GROUP');
define('T_ZSR', 'PHPCS_T_ZSR');
define('T_ZSR_EQUAL', 'PHPCS_T_ZSR_EQUAL');
define('T_FN_ARROW', 'T_FN_ARROW');
define('T_TYPE_UNION', 'T_TYPE_UNION');
define('T_PARAM_NAME', 'T_PARAM_NAME');
define('T_FN_ARROW', 'PHPCS_T_FN_ARROW');
define('T_TYPE_UNION', 'PHPCS_T_TYPE_UNION');
define('T_PARAM_NAME', 'PHPCS_T_PARAM_NAME');

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

0 comments on commit 10559a3

Please sign in to comment.