PHP Класс PhpCsFixer\Tokenizer\TokensAnalyzer

Its role is to provide the ability to analyze collection.
Автор: Dariusz Rumiński ([email protected])
Автор: Gregor Harlan ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__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 { .

Описание методов

__construct() публичный Метод

public __construct ( Tokens $tokens )
$tokens Tokens

getClassyElements() публичный Метод

Get indexes of methods and properties in classy code (classes, interfaces and traits).
public getClassyElements ( ) : array[]
Результат array[]

getImportUseIndexes() публичный Метод

Get indexes of namespace uses.
public getImportUseIndexes ( boolean $perNamespace = false ) : array | array[]
$perNamespace boolean Return namespace uses per namespace
Результат array | array[]

getMethodAttributes() публичный Метод

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)
Результат array

isAnonymousClass() публичный Метод

Check if there is an anonymous class under given index.
public isAnonymousClass ( integer $index ) : boolean
$index integer
Результат boolean

isArray() публичный Метод

Check if there is an array at given index.
public isArray ( integer $index ) : boolean
$index integer
Результат boolean

isArrayMultiLine() публичный Метод

This only checks the root-level of the array.
public isArrayMultiLine ( integer $index ) : boolean
$index integer
Результат boolean

isBinaryOperator() публичный Метод

Checks if there is a binary operator under given index.
public isBinaryOperator ( integer $index ) : boolean
$index integer
Результат boolean

isLambda() публичный Метод

Check if the function under given index is a lambda.
public isLambda ( integer $index ) : boolean
$index integer
Результат boolean

isUnaryPredecessorOperator() публичный Метод

Checks if there is an unary predecessor operator under given index.
public isUnaryPredecessorOperator ( integer $index ) : boolean
$index integer
Результат boolean

isUnarySuccessorOperator() публичный Метод

Checks if there is an unary successor operator under given index.
public isUnarySuccessorOperator ( integer $index ) : boolean
$index integer
Результат boolean

isWhilePartOfDoWhile() публичный Метод

.. } while (); syntax and not while () { ...}`.
public isWhilePartOfDoWhile ( integer $index ) : boolean
$index integer
Результат boolean