Collections
in package
Collections of related tokens as often used and needed for sniffs.
These are additional "token groups" to compliment the ones available through the PHPCS native Tokens class.
Tags
Table of Contents
Methods
- __callStatic() : array<int|string, int|string>
- Handle calls to (undeclared) methods for token arrays which don't need special handling.
- alternativeControlStructureSyntaxClosers() : array<string|int, mixed>
- alternativeControlStructureSyntaxes() : array<string|int, mixed>
- arrayOpenTokensBC() : array<int|string, int|string>
- Tokens which can open an array (PHPCS cross-version compatible).
- arrayTokens() : array<string|int, mixed>
- arrayTokensBC() : array<int|string, int|string>
- Tokens which are used to create arrays (PHPCS cross-version compatible).
- classModifierKeywords() : array<string|int, mixed>
- closedScopes() : array<string|int, mixed>
- constantModifierKeywords() : array<string|int, mixed>
- controlStructureTokens() : array<string|int, mixed>
- functionCallTokens() : array<int|string, int|string>
- Tokens which can represent function calls and function-call-like language constructs.
- functionDeclarationTokens() : array<string|int, mixed>
- incrementDecrementOperators() : array<string|int, mixed>
- listOpenTokensBC() : array<int|string, int|string>
- Tokens which can open a list construct (PHPCS cross-version compatible).
- listTokens() : array<string|int, mixed>
- listTokensBC() : array<int|string, int|string>
- Tokens which are used to create lists (PHPCS cross-version compatible).
- namespaceDeclarationClosers() : array<string|int, mixed>
- namespacedNameTokens() : array<int|string, int|string>
- Tokens types which can be encountered in a fully, partially or unqualified name.
- nameTokens() : array<string|int, mixed>
- objectOperators() : array<string|int, mixed>
- ooCanExtend() : array<string|int, mixed>
- ooCanImplement() : array<string|int, mixed>
- ooConstantScopes() : array<string|int, mixed>
- ooHierarchyKeywords() : array<string|int, mixed>
- ooPropertyScopes() : array<string|int, mixed>
- parameterPassingTokens() : array<int|string, int|string>
- Tokens which can be passed to the methods in the PassedParameter class.
- parameterTypeTokens() : array<int|string, int|string>
- Token types which can be encountered in a parameter type declaration.
- phpOpenTags() : array<string|int, mixed>
- propertyModifierKeywords() : array<string|int, mixed>
- propertyTypeTokens() : array<int|string, int|string>
- Token types which can be encountered in a property type declaration.
- returnTypeTokens() : array<int|string, int|string>
- Token types which can be encountered in a return type declaration.
- shortArrayListOpenTokensBC() : array<int|string, int|string>
- Tokens which can open a short array or short list (PHPCS cross-version compatible).
- shortArrayTokens() : array<string|int, mixed>
- shortArrayTokensBC() : array<int|string, int|string>
- Tokens which are used for short arrays (PHPCS cross-version compatible).
- shortListTokens() : array<string|int, mixed>
- shortListTokensBC() : array<int|string, int|string>
- Tokens which are used for short lists (PHPCS cross-version compatible).
- textStringStartTokens() : array<string|int, mixed>
Methods
__callStatic()
Handle calls to (undeclared) methods for token arrays which don't need special handling.
public
static __callStatic(string $name, array<string|int, mixed> $args) : array<int|string, int|string>
Parameters
- $name : string
-
The name of the method which has been called.
- $args : array<string|int, mixed>
-
Any arguments passed to the method. Unused as none of the methods take arguments.
Tags
Return values
array<int|string, int|string> —Token array
alternativeControlStructureSyntaxClosers()
public
static alternativeControlStructureSyntaxClosers() : array<string|int, mixed>
Tokens representing alternative control structure syntax closer keywords.
Return values
array<string|int, mixed>alternativeControlStructureSyntaxes()
public
static alternativeControlStructureSyntaxes() : array<string|int, mixed>
Tokens for control structures which can use the alternative control structure syntax.
Return values
array<string|int, mixed>arrayOpenTokensBC()
Tokens which can open an array (PHPCS cross-version compatible).
public
static arrayOpenTokensBC() : array<int|string, int|string>
For those PHPCS versions which need it, includes T_OPEN_SQUARE_BRACKET
to allow for
handling tokenizer issues related to the retokenization to T_OPEN_SHORT_ARRAY
.
Should only be used selectively.
Tags
Return values
array<int|string, int|string>arrayTokens()
public
static arrayTokens() : array<string|int, mixed>
Tokens which are used to create arrays.
Return values
array<string|int, mixed>arrayTokensBC()
Tokens which are used to create arrays (PHPCS cross-version compatible).
public
static arrayTokensBC() : array<int|string, int|string>
For those PHPCS versions which need it, includes T_OPEN_SQUARE_BRACKET
and T_CLOSE_SQUARE_BRACKET
to allow for handling tokenizer issues related to the retokenization to T_OPEN_SHORT_ARRAY
.
Should only be used selectively.
Tags
Return values
array<int|string, int|string>classModifierKeywords()
public
static classModifierKeywords() : array<string|int, mixed>
Modifier keywords which can be used for a class declaration.
Return values
array<string|int, mixed>closedScopes()
public
static closedScopes() : array<string|int, mixed>
List of tokens which represent "closed" scopes.
Return values
array<string|int, mixed>constantModifierKeywords()
public
static constantModifierKeywords() : array<string|int, mixed>
Tokens which can be used as modifiers for a constant declaration (in OO structures).
Return values
array<string|int, mixed>controlStructureTokens()
public
static controlStructureTokens() : array<string|int, mixed>
Control structure tokens.
Return values
array<string|int, mixed>functionCallTokens()
Tokens which can represent function calls and function-call-like language constructs.
public
static functionCallTokens() : array<int|string, int|string>
Tags
Return values
array<int|string, int|string>functionDeclarationTokens()
public
static functionDeclarationTokens() : array<string|int, mixed>
Tokens which represent a keyword which starts a function declaration.
Return values
array<string|int, mixed>incrementDecrementOperators()
public
static incrementDecrementOperators() : array<string|int, mixed>
Increment/decrement operator tokens.
Return values
array<string|int, mixed>listOpenTokensBC()
Tokens which can open a list construct (PHPCS cross-version compatible).
public
static listOpenTokensBC() : array<int|string, int|string>
For those PHPCS versions which need it, includes T_OPEN_SQUARE_BRACKET
to allow for
handling tokenizer issues related to the retokenization to T_OPEN_SHORT_ARRAY
.
Should only be used selectively.
Tags
Return values
array<int|string, int|string>listTokens()
public
static listTokens() : array<string|int, mixed>
Tokens which are used to create lists.
Return values
array<string|int, mixed>listTokensBC()
Tokens which are used to create lists (PHPCS cross-version compatible).
public
static listTokensBC() : array<int|string, int|string>
For those PHPCS versions which need it, includes T_OPEN_SQUARE_BRACKET
and T_CLOSE_SQUARE_BRACKET
to allow for handling tokenizer issues related to the retokenization to T_OPEN_SHORT_ARRAY
.
Should only be used selectively.
Tags
Return values
array<int|string, int|string>namespaceDeclarationClosers()
public
static namespaceDeclarationClosers() : array<string|int, mixed>
List of tokens which can end a namespace declaration statement.
Return values
array<string|int, mixed>namespacedNameTokens()
Tokens types which can be encountered in a fully, partially or unqualified name.
public
static namespacedNameTokens() : array<int|string, int|string>
Example:
echo namespace\Sub\ClassName::method();
Tags
Return values
array<int|string, int|string>nameTokens()
public
static nameTokens() : array<string|int, mixed>
Tokens used for "names", be it namespace, OO, function or constant names.
Return values
array<string|int, mixed>objectOperators()
public
static objectOperators() : array<string|int, mixed>
Object operator tokens.
Return values
array<string|int, mixed>ooCanExtend()
public
static ooCanExtend() : array<string|int, mixed>
OO structures which can use the "extends" keyword.
Return values
array<string|int, mixed>ooCanImplement()
public
static ooCanImplement() : array<string|int, mixed>
OO structures which can use the "implements" keyword.
Return values
array<string|int, mixed>ooConstantScopes()
public
static ooConstantScopes() : array<string|int, mixed>
OO scopes in which constants can be declared.
Return values
array<string|int, mixed>ooHierarchyKeywords()
public
static ooHierarchyKeywords() : array<string|int, mixed>
Tokens types used for "forwarding" calls within OO structures.
Return values
array<string|int, mixed>ooPropertyScopes()
public
static ooPropertyScopes() : array<string|int, mixed>
OO scopes in which properties can be declared.
Return values
array<string|int, mixed>parameterPassingTokens()
Tokens which can be passed to the methods in the PassedParameter class.
public
static parameterPassingTokens() : array<int|string, int|string>
Tags
Return values
array<int|string, int|string>parameterTypeTokens()
Token types which can be encountered in a parameter type declaration.
public
static parameterTypeTokens() : array<int|string, int|string>
Tags
Return values
array<int|string, int|string>phpOpenTags()
public
static phpOpenTags() : array<string|int, mixed>
Tokens which open PHP.
Return values
array<string|int, mixed>propertyModifierKeywords()
public
static propertyModifierKeywords() : array<string|int, mixed>
Modifier keywords which can be used for a property declaration.
Return values
array<string|int, mixed>propertyTypeTokens()
Token types which can be encountered in a property type declaration.
public
static propertyTypeTokens() : array<int|string, int|string>
Tags
Return values
array<int|string, int|string>returnTypeTokens()
Token types which can be encountered in a return type declaration.
public
static returnTypeTokens() : array<int|string, int|string>
Tags
Return values
array<int|string, int|string>shortArrayListOpenTokensBC()
Tokens which can open a short array or short list (PHPCS cross-version compatible).
public
static shortArrayListOpenTokensBC() : array<int|string, int|string>
For those PHPCS versions which need it, includes T_OPEN_SQUARE_BRACKET
to allow for
handling tokenizer issues related to the retokenization to T_OPEN_SHORT_ARRAY
.
Should only be used selectively.
Tags
Return values
array<int|string, int|string>shortArrayTokens()
public
static shortArrayTokens() : array<string|int, mixed>
Tokens which are used for short arrays.
Return values
array<string|int, mixed>shortArrayTokensBC()
Tokens which are used for short arrays (PHPCS cross-version compatible).
public
static shortArrayTokensBC() : array<int|string, int|string>
For those PHPCS versions which need it, includes T_OPEN_SQUARE_BRACKET
and T_CLOSE_SQUARE_BRACKET
to allow for handling tokenizer issues related to the retokenization to T_OPEN_SHORT_ARRAY
.
Should only be used selectively.
Tags
Return values
array<int|string, int|string>shortListTokens()
public
static shortListTokens() : array<string|int, mixed>
Tokens which are used for short lists.
Return values
array<string|int, mixed>shortListTokensBC()
Tokens which are used for short lists (PHPCS cross-version compatible).
public
static shortListTokensBC() : array<int|string, int|string>
For those PHPCS versions which need it, includes T_OPEN_SQUARE_BRACKET
and T_CLOSE_SQUARE_BRACKET
to allow for handling tokenizer issues related to the retokenization to T_OPEN_SHORT_ARRAY
.
Should only be used selectively.
Tags
Return values
array<int|string, int|string>textStringStartTokens()
public
static textStringStartTokens() : array<string|int, mixed>
Tokens which can start a - potentially multi-line - text string.