PHP Class Phan\Language\Scope

Show file Open project: etsy/phan Class Usage Examples

Protected Properties

Property Type Description
$variable_map Phan\Language\Element\Variable[]

Public Methods

Method Description
__construct ( Scope $parent_scope = null, FQSEN $fqsen = null )
__toString ( ) : string
addGlobalVariable ( Variable $variable ) : void
addTemplateType ( Phan\Language\Type\TemplateType $template_type ) : void
addVariable ( Variable $variable ) : void
getClassFQSEN ( ) : FullyQualifiedClassName
getFQSEN ( )
getFunctionLikeFQSEN ( ) : FullyQualifiedMethodName | FullyQualifiedFunctionName
getGlobalVariableByName ( string $name ) : Variable
getParentScope ( ) : Scope
getTemplateType ( string $template_type_identifier ) : Phan\Language\Type\TemplateType
getTemplateTypeMap ( ) : array
getVariableByName ( string $name ) : Variable
getVariableMap ( ) : array
hasAnyTemplateType ( ) : boolean
hasFQSEN ( ) : boolean
hasGlobalVariableWithName ( string $name ) : boolean
hasParentScope ( ) : boolean
hasTemplateType ( string $template_type_identifier ) : boolean
hasVariableWithName ( string $name ) : boolean
isInClassScope ( ) : boolean
isInFunctionLikeScope ( ) : boolean
withVariable ( Variable $variable ) : Scope

Method Details

__construct() public method

public __construct ( Scope $parent_scope = null, FQSEN $fqsen = null )
$parent_scope Scope
$fqsen FQSEN

__toString() public method

public __toString ( ) : string
return string A string representation of this scope

addGlobalVariable() public method

public addGlobalVariable ( Variable $variable ) : void
$variable Phan\Language\Element\Variable A variable to add to the set of global variables
return void

addTemplateType() public method

public addTemplateType ( Phan\Language\Type\TemplateType $template_type ) : void
$template_type Phan\Language\Type\TemplateType A template type parameterizing the generic class in scope
return void

addVariable() public method

public addVariable ( Variable $variable ) : void
$variable Phan\Language\Element\Variable
return void

getClassFQSEN() public method

public getClassFQSEN ( ) : FullyQualifiedClassName
return Phan\Language\FQSEN\FullyQualifiedClassName Crawl the scope hierarchy to get a class FQSEN.

getFQSEN() public method

public getFQSEN ( )

getFunctionLikeFQSEN() public method

public getFunctionLikeFQSEN ( ) : FullyQualifiedMethodName | FullyQualifiedFunctionName
return Phan\Language\FQSEN\FullyQualifiedMethodName | Phan\Language\FQSEN\FullyQualifiedFunctionName Crawl the scope hierarchy to get a method FQSEN.

getGlobalVariableByName() public method

public getGlobalVariableByName ( string $name ) : Variable
$name string
return Phan\Language\Element\Variable The global variable with the given name

getParentScope() public method

public getParentScope ( ) : Scope
return Scope Get the parent scope of this scope

getTemplateType() public method

public getTemplateType ( string $template_type_identifier ) : Phan\Language\Type\TemplateType
$template_type_identifier string
return Phan\Language\Type\TemplateType A TemplateType parameterizing the generic class in scope

getTemplateTypeMap() public method

public getTemplateTypeMap ( ) : array
return array The set of all template types parameterizing this generic class

getVariableByName() public method

public getVariableByName ( string $name ) : Variable
$name string
return Phan\Language\Element\Variable

getVariableMap() public method

public getVariableMap ( ) : array
return array A map from name to Variable in this scope

hasAnyTemplateType() public method

public hasAnyTemplateType ( ) : boolean
return boolean True if there are any template types parameterizing a generic class in this scope.

hasFQSEN() public method

public hasFQSEN ( ) : boolean
return boolean True if this scope has an FQSEN

hasGlobalVariableWithName() public method

public hasGlobalVariableWithName ( string $name ) : boolean
$name string
return boolean True if a global variable with the given name exists

hasParentScope() public method

public hasParentScope ( ) : boolean
return boolean True if this scope has a parent scope

hasTemplateType() public method

public hasTemplateType ( string $template_type_identifier ) : boolean
$template_type_identifier string
return boolean True if the given template type identifier is defined within this context

hasVariableWithName() public method

public hasVariableWithName ( string $name ) : boolean
$name string
return boolean True if a variable with the given name is defined within this scope

isInClassScope() public method

public isInClassScope ( ) : boolean
return boolean True if we're in a class scope

isInFunctionLikeScope() public method

public isInFunctionLikeScope ( ) : boolean
return boolean True if we're in a method/function/closure scope

withVariable() public method

public withVariable ( Variable $variable ) : Scope
$variable Phan\Language\Element\Variable A variable to add to the local scope
return Scope

Property Details

$variable_map protected property

protected Variable[],Phan\Language\Element $variable_map
return Phan\Language\Element\Variable[]