PHP Class Phan\Language\Context

Inheritance: extends FileRef
Afficher le fichier Open project: etsy/phan Class Usage Examples

Protected Properties

Свойство Type Description
$strict_types integer strict_types setting for the file

Méthodes publiques

Méthode Description
__construct ( ) Create a new context
addGlobalScopeVariable ( Variable $variable ) : void
addScopeVariable ( Variable $variable ) : null Add a variable to this context's scope. Note that this does not create a new context. You're actually injecting the variable into the context. Use with caution.
getClassFQSEN ( ) : FullyQualifiedClassName
getClassInScope ( CodeBase $code_base ) : Clazz
getElementInScope ( CodeBase $code_base ) : TypedElement
getFunctionLikeFQSEN ( ) *
getFunctionLikeInScope ( CodeBase $code_base ) : Phan\Language\Element\FunctionInterface
getIsStrictTypes ( ) : boolean
getNamespace ( ) : string
getNamespaceMapFor ( integer $flags, string $name ) : FullyQualifiedGlobalStructuralElement
getScope ( ) : Scope
getScope ( ) : Scope
hasNamespaceMapFor ( integer $flags, string $name ) : boolean
hasSuppressIssue ( CodeBase $code_base, string $issue_name ) : boolean
isInClassScope ( ) : boolean
isInElementScope ( ) : boolean
isInFunctionLikeScope ( ) : boolean
isInGlobalScope ( ) : boolean
isInMethodScope ( ) : boolean
setScope ( Scope $scope ) : void Set the scope on the context
setScope ( Scope $scope ) : void Set the scope on the context
withNamespace ( string $namespace ) : Context *
withNamespaceMap ( integer $flags, string $alias, FullyQualifiedGlobalStructuralElement $target ) : Context
withScope ( Scope $scope ) : Context
withScope ( Scope $scope ) : Context
withScopeVariable ( Variable $variable ) : Context
withStrictTypes ( integer $strict_types ) : Context

Method Details

__construct() public méthode

Create a new context
public __construct ( )

addGlobalScopeVariable() public méthode

public addGlobalScopeVariable ( Variable $variable ) : void
$variable Phan\Language\Element\Variable A variable to add to the scope for the new context
Résultat void

addScopeVariable() public méthode

Add a variable to this context's scope. Note that this does not create a new context. You're actually injecting the variable into the context. Use with caution.
public addScopeVariable ( Variable $variable ) : null
$variable Phan\Language\Element\Variable A variable to inject into this context
Résultat null

getClassFQSEN() public méthode

public getClassFQSEN ( ) : FullyQualifiedClassName
Résultat Phan\Language\FQSEN\FullyQualifiedClassName A fully-qualified structural element name describing the current class in scope.

getClassInScope() public méthode

public getClassInScope ( CodeBase $code_base ) : Clazz
$code_base Phan\CodeBase The global code base holding all state
Résultat Phan\Language\Element\Clazz Get the class in this scope, or fail real hard

getElementInScope() public méthode

public getElementInScope ( CodeBase $code_base ) : TypedElement
$code_base Phan\CodeBase The code base from which to retrieve the TypedElement
Résultat Phan\Language\Element\TypedElement The element who's scope we're in. If we're in the global scope this method will go down in flames and take your process with it.

getFunctionLikeFQSEN() public méthode

*

getFunctionLikeInScope() public méthode

public getFunctionLikeInScope ( CodeBase $code_base ) : Phan\Language\Element\FunctionInterface
$code_base Phan\CodeBase The global code base holding all state
Résultat Phan\Language\Element\FunctionInterface Get the method in this scope or fail real hard

getIsStrictTypes() public méthode

public getIsStrictTypes ( ) : boolean
Résultat boolean True if strict_types is set to 1 in this context.

getNamespace() public méthode

public getNamespace ( ) : string
Résultat string The namespace of the file

getNamespaceMapFor() public méthode

public getNamespaceMapFor ( integer $flags, string $name ) : FullyQualifiedGlobalStructuralElement
$flags integer
$name string
Résultat Phan\Language\FQSEN\FullyQualifiedGlobalStructuralElement The namespace mapped name for the given flags and name

getScope() public méthode

public getScope ( ) : Scope
Résultat Scope An object describing the contents of the current scope.

getScope() public méthode

public getScope ( ) : Scope
Résultat Scope An object describing the contents of the current scope.

hasNamespaceMapFor() public méthode

public hasNamespaceMapFor ( integer $flags, string $name ) : boolean
$flags integer
$name string
Résultat boolean True if we have a mapped NS for the given named element

hasSuppressIssue() public méthode

public hasSuppressIssue ( CodeBase $code_base, string $issue_name ) : boolean
$code_base Phan\CodeBase The code base from which to retrieve a possible TypedElement that contains an issue suppression list
$issue_name string
Résultat boolean True if issues with the given name are suppressed within this context.

isInClassScope() public méthode

public isInClassScope ( ) : boolean
Résultat boolean True if this context is currently within a class scope, else false.

isInElementScope() public méthode

public isInElementScope ( ) : boolean
Résultat boolean True if we're within the scope of a class, method, function or closure. False if we're in the global scope

isInFunctionLikeScope() public méthode

public isInFunctionLikeScope ( ) : boolean
Résultat boolean True if this context is currently within a method, function or closure scope.

isInGlobalScope() public méthode

public isInGlobalScope ( ) : boolean
Résultat boolean True if we're in the global scope (not in a class, method, function, closure).

isInMethodScope() public méthode

public isInMethodScope ( ) : boolean
Résultat boolean True if this context is currently within a method.

setScope() public méthode

Set the scope on the context
public setScope ( Scope $scope ) : void
$scope Scope
Résultat void

setScope() public méthode

Set the scope on the context
public setScope ( Scope $scope ) : void
$scope Scope
Résultat void

withNamespace() public méthode

*
public withNamespace ( string $namespace ) : Context
$namespace string The namespace of the file
Résultat Context A clone of this context with the given value is returned

withNamespaceMap() public méthode

public withNamespaceMap ( integer $flags, string $alias, FullyQualifiedGlobalStructuralElement $target ) : Context
$flags integer
$alias string
$target Phan\Language\FQSEN\FullyQualifiedGlobalStructuralElement
Résultat Context This context with the given value is returned

withScope() public méthode

public withScope ( Scope $scope ) : Context
$scope Scope
Résultat Context A new context with the given scope

withScope() public méthode

public withScope ( Scope $scope ) : Context
$scope Scope
Résultat Context A new context with the given scope

withScopeVariable() public méthode

public withScopeVariable ( Variable $variable ) : Context
$variable Phan\Language\Element\Variable A variable to add to the scope for the new context
Résultat Context A new context based on this with a variable as defined by the parameters in scope

withStrictTypes() public méthode

public withStrictTypes ( integer $strict_types ) : Context
$strict_types integer The strict_type setting for the file
Résultat Context This context with the given value is returned

Property Details

$strict_types protected_oe property

strict_types setting for the file
protected int $strict_types
Résultat integer