Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
8260154
Collections: deprecate $alternativeControlStructureSyntax* in favour …
jrfnl Apr 18, 2022
b562012
Collections: remove $arrayOpenTokensBC in favour of arrayOpenTokensBC()
jrfnl Apr 18, 2022
f43285b
Collections: deprecate $arrayTokens[BC] in favour of arrayTokens[BC]()
jrfnl Apr 19, 2022
af7cb9c
Collections: deprecate $classModifierKeywords in favour of classModif…
jrfnl Apr 18, 2022
92851d6
Collections: deprecate $closedScopes in favour of closedScopes()
jrfnl Apr 18, 2022
ad51382
Collections: deprecate $controlStructureTokens in favour of controlSt…
jrfnl Apr 18, 2022
5d030c8
Collections: deprecate $incrementDecrementOperators in favour of incr…
jrfnl Apr 18, 2022
97ab380
Collections: deprecate $listTokens[BC] in favour of listTokens[BC]()
jrfnl Apr 19, 2022
5049b56
Collections: deprecate $magicConstants in favour of BCTokens::magicCo…
jrfnl Apr 18, 2022
ee54944
Collections: deprecate $namespaceDeclarationClosers in favour of name…
jrfnl Apr 18, 2022
45a7ef9
Collections: deprecate $OOCan(Implement|Extend) in favour of ooCan(Im…
jrfnl Apr 18, 2022
08dd4eb
Collections: deprecate $OO(Constant|Property)Scopes in favour of oo(C…
jrfnl Apr 18, 2022
3982d00
Collections: deprecate $OOHierarchyKeywords in favour of ooHierarchyK…
jrfnl Apr 18, 2022
4cb99ee
Collections: deprecate $propertyModifierKeywords in favour of propert…
jrfnl Apr 18, 2022
8da1f54
Collections: deprecate $shortArrayTokens[BC] in favour of shortArrayT…
jrfnl Apr 19, 2022
17e1b75
Collections: deprecate $shortListTokens[BC] in favour of shortListTok…
jrfnl Apr 19, 2022
a44b016
Collections: deprecate $textStingStartTokens in favour of textStingSt…
jrfnl Apr 18, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion PHPCSUtils/BackCompat/BCFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ public static function getMemberProperties(File $phpcsFile, $stackPtr)
}
}

$valid = Collections::$propertyModifierKeywords;
$valid = Collections::propertyModifierKeywords();
$valid += Tokens::$emptyTokens;

$scope = 'public';
Expand Down
23 changes: 20 additions & 3 deletions PHPCSUtils/BackCompat/BCTokens.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,24 @@ class BCTokens
\T_NOWDOC => \T_NOWDOC,
];

/**
* Tokens representing PHP magic constants.
*
* @since 1.0.0-alpha4
*
* @var array <int|string> => <int|string>
*/
private 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,
];

/**
* Handle calls to (undeclared) methods for token arrays which haven't received any
* changes since PHPCS 2.6.0.
Expand Down Expand Up @@ -467,8 +485,7 @@ public static function ooScopeTokens()
* Changelog for the PHPCS native array:
* - Introduced in PHPCS 3.5.6.
*
* @see \PHP_CodeSniffer\Util\Tokens::$magicConstants Original array.
* @see \PHPCSUtils\Tokens\Collections::$magicConstants Same array, pre-dating the PHPCS change.
* @see \PHP_CodeSniffer\Util\Tokens::$magicConstants Original array.
*
* @link https://www.php.net/language.constants.predefined PHP Manual on magic constants
*
Expand All @@ -482,7 +499,7 @@ public static function magicConstants()
return Tokens::$magicConstants;
}

return Collections::$magicConstants;
return self::$magicConstants;
}

/**
Expand Down
Loading