Метод |
Описание |
|
__clone ( ) |
Clone tokens collection. |
|
clearCache ( string | null $key = null ) |
Clear cache - one position or all of them. |
|
clearChanged ( ) |
Clear internal flag if collection was changed and flag for all collection's items. |
|
clearEmptyTokens ( ) |
Clear empty tokens. |
|
clearRange ( integer $indexStart, integer $indexEnd ) |
Clear tokens in the given range. |
|
clearTokenAndMergeSurroundingWhitespace ( integer $index ) |
Clear token and merge surrounding whitespace tokens. |
|
detectBlockType ( PhpCsFixer\Tokenizer\Token $token ) : null | array |
Detect type of block. |
|
ensureWhitespaceAtIndex ( integer $index, integer $indexOffset, string $whitespace ) : boolean |
Ensure that on given index is a whitespace with given kind. |
|
findBlockEnd ( integer $type, integer $searchIndex, boolean $findEnd = true ) : integer |
Find block end. |
|
findGivenKind ( integer | array $possibleKind, integer $start, integer | null $end = null ) : array |
Find tokens of given kind. |
|
findSequence ( array $sequence, integer $start, integer $end = null, boolean | array $caseSensitive = true ) : array | null |
Find a sequence of meaningful tokens and returns the array of their locations. |
|
fromArray ( PhpCsFixer\Tokenizer\Token[] $array, boolean $saveIndexes = null ) : Tokens |
Create token collection from array. |
|
fromCode ( string $code ) : Tokens |
Create token collection directly from code. |
|
generateCode ( ) : string |
Generate code from tokens. |
|
generatePartialCode ( integer $start, integer $end ) : string |
Generate code from tokens between given indexes. |
|
getBlockEdgeDefinitions ( ) : array |
Return block edge definitions. |
|
getCodeHash ( ) : string |
Get hash of code. |
|
getMeaningfulTokenSibling ( integer $index, integer $direction ) : integer | null |
Get index for closest sibling token that is not a whitespace or comment. |
|
getNextMeaningfulToken ( integer $index ) : integer | null |
Get index for closest next token that is not a whitespace or comment. |
|
getNextNonWhitespace ( integer $index, null | string $whitespaces = null ) : integer | null |
Get index for closest next token which is non whitespace. |
|
getNextTokenOfKind ( integer $index, array $tokens = [], boolean $caseSensitive = true ) : integer | null |
Get index for closest next token of given kind. |
|
getNonEmptySibling ( integer $index, integer $direction ) : integer | null |
Get index for closest sibling token which is not empty. |
|
getNonWhitespaceSibling ( integer $index, integer $direction, null | string $whitespaces = null ) : integer | null |
Get index for closest sibling token which is non whitespace. |
|
getPrevMeaningfulToken ( integer $index ) : integer | null |
Get index for closest previous token that is not a whitespace or comment. |
|
getPrevNonWhitespace ( integer $index, null | string $whitespaces = null ) : integer | null |
Get index for closest previous token which is non whitespace. |
|
getPrevTokenOfKind ( integer $index, array $tokens = [], boolean $caseSensitive = true ) : integer | null |
Get index for closest previous token of given kind. |
|
getTokenNotOfKindSibling ( integer $index, integer $direction, array $tokens = [] ) : integer | null |
Get index for closest sibling token not of given kind. |
|
getTokenOfKindSibling ( integer $index, integer $direction, array $tokens = [], boolean $caseSensitive = true ) : integer | null |
Get index for closest sibling token of given kind. |
|
insertAt ( integer $index, Tokens | PhpCsFixer\Tokenizer\Token[] | PhpCsFixer\Tokenizer\Token $items ) |
Insert instances of Token inside collection. |
|
isAllTokenKindsFound ( array $tokenKinds ) : boolean |
Check if all token kinds given as argument are found. |
|
isAnyTokenKindsFound ( array $tokenKinds ) : boolean |
Check if any token kind given as argument is found. |
|
isChanged ( ) : boolean |
Check if collection was change: collection itself (like insert new tokens) or any of collection's elements. |
|
isMonolithicPhp ( ) : boolean |
Checks for monolithic PHP code. |
|
isPartialCodeMultiline ( integer $start, integer $end ) : boolean |
Check if partial code is multiline. |
|
isTokenKindFound ( integer | string $tokenKind ) : boolean |
Check if token kind given as argument is found. |
|
offsetSet ( integer $index, PhpCsFixer\Tokenizer\Token $newval ) |
Set collection item. |
|
offsetUnset ( integer $index ) |
Unset collection item. |
|
overrideAt ( integer $index, PhpCsFixer\Tokenizer\Token | array | string $token ) |
Override token at given index and register it. |
|
overrideRange ( integer $indexStart, integer $indexEnd, Tokens | PhpCsFixer\Tokenizer\Token[] $items ) |
Override tokens at given range. |
|
removeLeadingWhitespace ( integer $index, null | string $whitespaces = null ) |
Removes all the leading whitespace. |
|
removeTrailingWhitespace ( integer $index, null | string $whitespaces = null ) |
Removes all the trailing whitespace. |
|
setCode ( string $code ) |
Set code. Clear all current content and replace it by new Token items generated from code directly. |
|
setSize ( integer $size ) |
Set new size of collection. |
|
toJson ( ) |
|
|