Skip to content

Commit

Permalink
Merge pull request #634 from PHPCSStandards/feature/bctokens-collecti…
Browse files Browse the repository at this point in the history
…ons-improve-method-tags

Docs: improve specificity
  • Loading branch information
jrfnl authored Nov 8, 2024
2 parents e7c1d70 + 301e2d3 commit be5942a
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 60 deletions.
52 changes: 27 additions & 25 deletions PHPCSUtils/BackCompat/BCTokens.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,31 +43,33 @@
*
* @since 1.0.0
*
* @method static array arithmeticTokens() Tokens that represent arithmetic operators.
* @method static array assignmentTokens() Tokens that represent assignments.
* @method static array blockOpeners() Tokens that open code blocks.
* @method static array booleanOperators() Tokens that perform boolean operations.
* @method static array bracketTokens() Tokens that represent brackets and parenthesis.
* @method static array castTokens() Tokens that represent type casting.
* @method static array commentTokens() Tokens that are comments.
* @method static array comparisonTokens() Tokens that represent comparison operator.
* @method static array contextSensitiveKeywords() Tokens representing context sensitive keywords in PHP.
* @method static array emptyTokens() Tokens that don't represent code.
* @method static array equalityTokens() Tokens that represent equality comparisons.
* @method static array heredocTokens() Tokens that make up a heredoc string.
* @method static array includeTokens() Tokens that include files.
* @method static array magicConstants() Tokens representing PHP magic constants.
* @method static array methodPrefixes() Tokens that can prefix a method name.
* @method static array ooScopeTokens() Tokens that open class and object scopes.
* @method static array operators() Tokens that perform operations.
* @method static array parenthesisOpeners() Token types that open parenthesis.
* @method static array phpcsCommentTokens() Tokens that are comments containing PHPCS instructions.
* @method static array scopeModifiers() Tokens that represent scope modifiers.
* @method static array scopeOpeners() Tokens that are allowed to open scopes.
* @method static array stringTokens() Tokens that represent strings.
* Note that `T_STRING`s are NOT represented in this list as this list
* is about _text_ strings.
* @method static array textStringTokens() Tokens that represent text strings.
* @method static array<int|string, int|string> arithmeticTokens() Tokens that represent arithmetic operators.
* @method static array<int|string, int|string> assignmentTokens() Tokens that represent assignments.
* @method static array<int|string, int|string> blockOpeners() Tokens that open code blocks.
* @method static array<int|string, int|string> booleanOperators() Tokens that perform boolean operations.
* @method static array<int|string, int|string> bracketTokens() Tokens that represent brackets and parenthesis.
* @method static array<int|string, int|string> castTokens() Tokens that represent type casting.
* @method static array<int|string, int|string> commentTokens() Tokens that are comments.
* @method static array<int|string, int|string> comparisonTokens() Tokens that represent comparison operator.
* @method static array<int|string, int|string> contextSensitiveKeywords() Tokens representing context sensitive keywords
* in PHP.
* @method static array<int|string, int|string> emptyTokens() Tokens that don't represent code.
* @method static array<int|string, int|string> equalityTokens() Tokens that represent equality comparisons.
* @method static array<int|string, int|string> heredocTokens() Tokens that make up a heredoc string.
* @method static array<int|string, int|string> includeTokens() Tokens that include files.
* @method static array<int|string, int|string> magicConstants() Tokens representing PHP magic constants.
* @method static array<int|string, int|string> methodPrefixes() Tokens that can prefix a method name.
* @method static array<int|string, int|string> ooScopeTokens() Tokens that open class and object scopes.
* @method static array<int|string, int|string> operators() Tokens that perform operations.
* @method static array<int|string, int|string> parenthesisOpeners() Token types that open parenthesis.
* @method static array<int|string, int|string> phpcsCommentTokens() Tokens that are comments containing PHPCS
* instructions.
* @method static array<int|string, int|string> scopeModifiers() Tokens that represent scope modifiers.
* @method static array<int|string, int|string> scopeOpeners() Tokens that are allowed to open scopes.
* @method static array<int|string, int|string> stringTokens() Tokens that represent strings.
* Note that `T_STRING`s are NOT represented in this
* list as this list is about _text_ strings.
* @method static array<int|string, int|string> textStringTokens() Tokens that represent text strings.
*/
final class BCTokens
{
Expand Down
86 changes: 51 additions & 35 deletions PHPCSUtils/Tokens/Collections.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,41 +23,57 @@
*
* @since 1.0.0
*
* @method static array alternativeControlStructureSyntaxes() Tokens for control structures which can use the
* alternative control structure syntax.
* @method static array alternativeControlStructureSyntaxClosers() Tokens representing alternative control structure
* syntax closer keywords.
* @method static array arrayTokens() Tokens which are used to create arrays.
* @method static array classModifierKeywords() Modifier keywords which can be used for a class
* declaration.
* @method static array closedScopes() List of tokens which represent "closed" scopes.
* @method static array constantModifierKeywords() Tokens which can be used as modifiers for a constant
* declaration (in OO structures).
* @method static array controlStructureTokens() Control structure tokens.
* @method static array functionDeclarationTokens() Tokens which represent a keyword which starts
* a function declaration.
* @method static array incrementDecrementOperators() Increment/decrement operator tokens.
* @method static array listTokens() Tokens which are used to create lists.
* @method static array namespaceDeclarationClosers() List of tokens which can end a namespace
* declaration statement.
* @method static array nameTokens() Tokens used for "names", be it namespace, OO,
* function
* or constant names.
* @method static array objectOperators() Object operator tokens.
* @method static array ooCanExtend() OO structures which can use the "extends" keyword.
* @method static array ooCanImplement() OO structures which can use the "implements" keyword.
* @method static array ooConstantScopes() OO scopes in which constants can be declared.
* @method static array ooHierarchyKeywords() Tokens types used for "forwarding" calls within
* OO structures.
* @method static array ooPropertyScopes() OO scopes in which properties can be declared.
* @method static array phpOpenTags() Tokens which open PHP.
* @method static array propertyModifierKeywords() Modifier keywords which can be used for a property
* declaration.
* @method static array shortArrayTokens() Tokens which are used for short arrays.
* @method static array shortListTokens() Tokens which are used for short lists.
* @method static array ternaryOperators() Tokens which represent ternary operators.
* @method static array textStringStartTokens() Tokens which can start a - potentially multi-line -
* text string.
* @method static array<int|string, int|string> alternativeControlStructureSyntaxes() Tokens for control structures
* which can use the alternative
* control structure syntax.
* @method static array<int|string, int|string> alternativeControlStructureSyntaxClosers() Tokens representing alternative
* control structure syntax closer
* keywords.
* @method static array<int|string, int|string> arrayTokens() Tokens which are used to create
* arrays.
* @method static array<int|string, int|string> classModifierKeywords() Modifier keywords which can be
* used for a class declaration.
* @method static array<int|string, int|string> closedScopes() List of tokens which represent
* "closed" scopes.
* @method static array<int|string, int|string> constantModifierKeywords() Tokens which can be used as
* modifiers for a constant
* declaration (in OO structures).
* @method static array<int|string, int|string> controlStructureTokens() Control structure tokens.
* @method static array<int|string, int|string> functionDeclarationTokens() Tokens which represent a keyword
* which starts a function
* declaration.
* @method static array<int|string, int|string> incrementDecrementOperators() Increment/decrement operator
* tokens.
* @method static array<int|string, int|string> listTokens() Tokens which are used to create
* lists.
* @method static array<int|string, int|string> namespaceDeclarationClosers() List of tokens which can end a
* namespace declaration statement.
* @method static array<int|string, int|string> nameTokens() Tokens used for "names", be it
* namespace, OO, function or
* constant names.
* @method static array<int|string, int|string> objectOperators() Object operator tokens.
* @method static array<int|string, int|string> ooCanExtend() OO structures which can use the
* "extends" keyword.
* @method static array<int|string, int|string> ooCanImplement() OO structures which can use the
* "implements" keyword.
* @method static array<int|string, int|string> ooConstantScopes() OO scopes in which constants can
* be declared.
* @method static array<int|string, int|string> ooHierarchyKeywords() Tokens types used for "forwarding"
* calls within OO structures.
* @method static array<int|string, int|string> ooPropertyScopes() OO scopes in which properties can
* be declared.
* @method static array<int|string, int|string> phpOpenTags() Tokens which open PHP.
* @method static array<int|string, int|string> propertyModifierKeywords() Modifier keywords which can be
* used for a property declaration.
* @method static array<int|string, int|string> shortArrayTokens() Tokens which are used for
* short arrays.
* @method static array<int|string, int|string> shortListTokens() Tokens which are used for
* short lists.
* @method static array<int|string, int|string> ternaryOperators() Tokens which represent ternary
* operators.
* @method static array<int|string, int|string> textStringStartTokens() Tokens which can start a
* - potentially multi-line -
* text string.
*/
final class Collections
{
Expand Down

0 comments on commit be5942a

Please sign in to comment.