From 79a8aef4b7b81b82bb61245c4c583d97d9434884 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Fri, 13 Mar 2020 19:47:54 +0100 Subject: [PATCH] Tokens\Collections: add new `$magicConstants` property Ref: https://www.php.net/manual/en/language.constants.predefined.php --- PHPCSUtils/Tokens/Collections.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/PHPCSUtils/Tokens/Collections.php b/PHPCSUtils/Tokens/Collections.php index 8c41bcfe..f78698ac 100644 --- a/PHPCSUtils/Tokens/Collections.php +++ b/PHPCSUtils/Tokens/Collections.php @@ -185,6 +185,26 @@ class Collections \T_CLOSE_SQUARE_BRACKET => \T_CLOSE_SQUARE_BRACKET, ]; + /** + * Tokens for the PHP magic constants. + * + * @since 1.0.0 + * + * @link https://www.php.net/manual/en/language.constants.predefined.php. + * + * @var array => + */ + public static $magicConstants = [ + \T_CLASS_C => \T_CLASS_C, + \T_DIR => \T_DIR, + \T_FILE => \T_FILE, + \T_FUNC_C => \T_FUNC_C, + \T_LINE => \T_LINE, + \T_METHOD_C => \T_METHOD_C, + \T_NS_C => \T_NS_C, + \T_TRAIT_C => \T_TRAIT_C, + ]; + /** * List of tokens which can end a namespace declaration statement. *