PHP Class Phan\Language\Scope\GlobalScope

Inheritance: extends Phan\Language\Scope
Show file Open project: etsy/phan

Public Methods

Method Description
addGlobalVariable ( Variable $variable ) : void
addVariable ( Variable $variable ) : void
getGlobalVariableByName ( string $name ) : Variable
getVariableByName ( string $name ) : Variable
getVariableMap ( ) : array
hasGlobalVariableWithName ( string $name ) : boolean
hasVariableWithName ( string $name ) : boolean
isInClassScope ( ) : boolean
isInFunctionLikeScope ( ) : boolean
withVariable ( Variable $variable ) : Scope

Method Details

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

addVariable() public method

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

getGlobalVariableByName() public method

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

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

hasGlobalVariableWithName() public method

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

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 Phan\Language\Scope