From 10559a38856ee2b2504f42570cb7de47a72e193d Mon Sep 17 00:00:00 2001 From: jrfnl Date: Sat, 13 Feb 2021 18:58:20 +0100 Subject: [PATCH] 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. --- src/Util/Tokens.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Util/Tokens.php b/src/Util/Tokens.php index ac05362676..1920e0987f 100644 --- a/src/Util/Tokens.php +++ b/src/Util/Tokens.php @@ -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) {