PHP Class PhpCsFixer\Tokenizer\TokensAnalyzer

Its role is to provide the ability to analyze collection.
Author: Dariusz Rumiński ([email protected])
Author: Gregor Harlan ([email protected])
Afficher le fichier Open project: friendsofphp/php-cs-fixer Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( Tokens $tokens )
getClassyElements ( ) : array[] Get indexes of methods and properties in classy code (classes, interfaces and traits).
getImportUseIndexes ( boolean $perNamespace = false ) : array | array[] Get indexes of namespace uses.
getMethodAttributes ( integer $index ) : array Returns the attributes of the method under the given index.
isAnonymousClass ( integer $index ) : boolean Check if there is an anonymous class under given index.
isArray ( integer $index ) : boolean Check if there is an array at given index.
isArrayMultiLine ( integer $index ) : boolean Check if the array at index is multiline.
isBinaryOperator ( integer $index ) : boolean Checks if there is a binary operator under given index.
isLambda ( integer $index ) : boolean Check if the function under given index is a lambda.
isUnaryPredecessorOperator ( integer $index ) : boolean Checks if there is an unary predecessor operator under given index.
isUnarySuccessorOperator ( integer $index ) : boolean Checks if there is an unary successor operator under given index.
isWhilePartOfDoWhile ( integer $index ) : boolean Check if T_WHILE token at given index is `do { .

Method Details

__construct() public méthode

public __construct ( Tokens $tokens )
$tokens Tokens

getClassyElements() public méthode

Get indexes of methods and properties in classy code (classes, interfaces and traits).
public getClassyElements ( ) : array[]
Résultat array[]

getImportUseIndexes() public méthode

Get indexes of namespace uses.
public getImportUseIndexes ( boolean $perNamespace = false ) : array | array[]
$perNamespace boolean Return namespace uses per namespace
Résultat array | array[]

getMethodAttributes() public méthode

The array has the following items: 'visibility' int|null T_PRIVATE, T_PROTECTED or T_PUBLIC 'static' bool 'abstract' bool 'final' bool
public getMethodAttributes ( integer $index ) : array
$index integer Token index of the method (T_FUNCTION)
Résultat array

isAnonymousClass() public méthode

Check if there is an anonymous class under given index.
public isAnonymousClass ( integer $index ) : boolean
$index integer
Résultat boolean

isArray() public méthode

Check if there is an array at given index.
public isArray ( integer $index ) : boolean
$index integer
Résultat boolean

isArrayMultiLine() public méthode

This only checks the root-level of the array.
public isArrayMultiLine ( integer $index ) : boolean
$index integer
Résultat boolean

isBinaryOperator() public méthode

Checks if there is a binary operator under given index.
public isBinaryOperator ( integer $index ) : boolean
$index integer
Résultat boolean

isLambda() public méthode

Check if the function under given index is a lambda.
public isLambda ( integer $index ) : boolean
$index integer
Résultat boolean

isUnaryPredecessorOperator() public méthode

Checks if there is an unary predecessor operator under given index.
public isUnaryPredecessorOperator ( integer $index ) : boolean
$index integer
Résultat boolean

isUnarySuccessorOperator() public méthode

Checks if there is an unary successor operator under given index.
public isUnarySuccessorOperator ( integer $index ) : boolean
$index integer
Résultat boolean

isWhilePartOfDoWhile() public méthode

.. } while (); syntax and not while () { ...}`.
public isWhilePartOfDoWhile ( integer $index ) : boolean
$index integer
Résultat boolean