PHP Класс Phan\Language\Element\Variable

Наследование: extends TypedElement
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
__construct ( Context $context, string $name, UnionType $type, integer $flags )
__toString ( ) : string
asNonVariadic ( ) : static Stub for compatibility with Parameter, since we replace the Parameter with a Variable and call setParameterList in PostOrderAnalysisVisitor->visitStaticCall TODO: Should that code create a new Parameter instance instead?
fromNodeInContext ( ast\Node $node, Context $context, CodeBase $code_base, boolean $should_check_type = true ) : Variable
getUnionTypeOfHardcodedGlobalVariableWithName ( string $name, Context $context ) : UnionType | null
getVariadicElementUnionType ( ) : UnionType Variables can't be variadic. This is the same as getUnionType for variables, but not necessarily for subclasses. Method will return the element type (such as DateTime) for variadic parameters.
isHardcodedGlobalVariableWithName ( string $name ) : boolean Returns true for all superglobals and variables in globals_type_map.
isPassByReference ( ) : boolean
isSuperglobalVariableWithName ( string $name ) : boolean
isVariadic ( ) : boolean

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

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

public __construct ( Context $context, string $name, UnionType $type, integer $flags )
$context Phan\Language\Context The context in which the structural element lives
$name string
$type Phan\Language\UnionType
$flags integer

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

public __toString ( ) : string
Результат string

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

Stub for compatibility with Parameter, since we replace the Parameter with a Variable and call setParameterList in PostOrderAnalysisVisitor->visitStaticCall TODO: Should that code create a new Parameter instance instead?
public asNonVariadic ( ) : static
Результат static

fromNodeInContext() публичный статический Метод

public static fromNodeInContext ( ast\Node $node, Context $context, CodeBase $code_base, boolean $should_check_type = true ) : Variable
$node ast\Node An AST_VAR node
$context Phan\Language\Context The context in which the variable is found
$code_base Phan\CodeBase
$should_check_type boolean
Результат Variable A variable begotten from a node

getUnionTypeOfHardcodedGlobalVariableWithName() публичный статический Метод

public static getUnionTypeOfHardcodedGlobalVariableWithName ( string $name, Context $context ) : UnionType | null
$name string
$context Phan\Language\Context
Результат Phan\Language\UnionType | null Returns UnionType (Possible with empty set) if and only if isHardcodedGlobalVariableWithName is true. Returns null otherwise.

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

Variables can't be variadic. This is the same as getUnionType for variables, but not necessarily for subclasses. Method will return the element type (such as DateTime) for variadic parameters.
public getVariadicElementUnionType ( ) : UnionType
Результат Phan\Language\UnionType

isHardcodedGlobalVariableWithName() публичный статический Метод

Returns true for all superglobals and variables in globals_type_map.
public static isHardcodedGlobalVariableWithName ( string $name ) : boolean
$name string
Результат boolean

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

public isPassByReference ( ) : boolean
Результат boolean This will always return false in so far as variables cannot be passed by reference.

isSuperglobalVariableWithName() публичный статический Метод

public static isSuperglobalVariableWithName ( string $name ) : boolean
$name string
Результат boolean True if the variable with the given name is a superglobal Implies Variable::isHardcodedGlobalVariableWithName($name) is true

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

public isVariadic ( ) : boolean
Результат boolean This will always return false in so far as variables cannot be variadic