PHP Class Phan\AST\ContextNode

Mostra file Open project: etsy/phan Class Usage Examples

Public Methods

Method Description
__construct ( CodeBase $code_base, Context $context, ast\Node | string | null $node )
analyzeBackwardCompatibility ( ) : void Perform some backwards compatibility checks on a node
getClassConst ( ) : Phan\Language\Element\ClassConstant
getClassList ( boolean $ignore_missing_classes = false ) : Clazz[]
getClosure ( ) : Func
getConst ( ) : Phan\Language\Element\GlobalConstant
getFunction ( string $function_name, boolean $is_function_declaration = false ) : Phan\Language\Element\FunctionInterface
getMethod ( ast\Node | string $method_name, boolean $is_static ) : Method
getOrCreateProperty ( string $property_name ) : Phan\Language\Element\Property
getOrCreateVariable ( ) : Variable
getProperty ( string | ast\Node $property_name ) : Phan\Language\Element\Property
getQualifiedName ( ) : string Get a fully qualified name form a node
getQualifiedNameList ( ) : array Get a list of fully qualified names from a node
getUnqualifiedNameForAnonymousClass ( ) : string
getVariable ( ) : Variable
getVariableName ( ) : string

Method Details

__construct() public method

public __construct ( CodeBase $code_base, Context $context, ast\Node | string | null $node )
$code_base Phan\CodeBase
$context Phan\Language\Context
$node ast\Node | string | null

analyzeBackwardCompatibility() public method

Perform some backwards compatibility checks on a node
public analyzeBackwardCompatibility ( ) : void
return void

getClassConst() public method

public getClassConst ( ) : Phan\Language\Element\ClassConstant
return Phan\Language\Element\ClassConstant Get the (non-class) constant associated with this node in this context

getClassList() public method

public getClassList ( boolean $ignore_missing_classes = false ) : Clazz[]
$ignore_missing_classes boolean If set to true, missing classes will be ignored and exceptions will be inhibited
return Phan\Language\Element\Clazz[] A list of classes representing the non-native types associated with the given node

getClosure() public method

public getClosure ( ) : Func
return Phan\Language\Element\Func

getConst() public method

public getConst ( ) : Phan\Language\Element\GlobalConstant
return Phan\Language\Element\GlobalConstant Get the (non-class) constant associated with this node in this context

getFunction() public method

public getFunction ( string $function_name, boolean $is_function_declaration = false ) : Phan\Language\Element\FunctionInterface
$function_name string The name of the function we'd like to look up
$is_function_declaration boolean This must be set to true if we're getting a function that is being declared and false if we're getting a function being called.
return Phan\Language\Element\FunctionInterface A method with the given name in the given context

getMethod() public method

public getMethod ( ast\Node | string $method_name, boolean $is_static ) : Method
$method_name ast\Node | string Either then name of the method or a node that produces the name of the method.
$is_static boolean Set to true if this is a static method call
return Phan\Language\Element\Method A method with the given name on the class referenced from the given node

getOrCreateProperty() public method

public getOrCreateProperty ( string $property_name ) : Phan\Language\Element\Property
$property_name string
return Phan\Language\Element\Property A variable in scope or a new variable

getOrCreateVariable() public method

public getOrCreateVariable ( ) : Variable
return Phan\Language\Element\Variable A variable in scope or a new variable

getProperty() public method

public getProperty ( string | ast\Node $property_name ) : Phan\Language\Element\Property
$property_name string | ast\Node The name of the property we're looking up
return Phan\Language\Element\Property A variable in scope or a new variable

getQualifiedName() public method

Get a fully qualified name form a node
public getQualifiedName ( ) : string
return string

getQualifiedNameList() public method

Get a list of fully qualified names from a node
public getQualifiedNameList ( ) : array
return array

getUnqualifiedNameForAnonymousClass() public method

public getUnqualifiedNameForAnonymousClass ( ) : string
return string A unique and stable name for an anonymous class

getVariable() public method

public getVariable ( ) : Variable
return Phan\Language\Element\Variable A variable in scope or a new variable

getVariableName() public method

public getVariableName ( ) : string
return string A variable name associated with the given node