PHP Класс Phan\Language\Context

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

Защищенные свойства (Protected)

Свойство Тип Описание
$strict_types integer strict_types setting for the file

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

Метод Описание
__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

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

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

Create a new context
public __construct ( )

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

public addGlobalScopeVariable ( Variable $variable ) : void
$variable Phan\Language\Element\Variable A variable to add to the scope for the new context
Результат void

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

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
Результат null

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

public getClassFQSEN ( ) : FullyQualifiedClassName
Результат Phan\Language\FQSEN\FullyQualifiedClassName A fully-qualified structural element name describing the current class in scope.

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

public getClassInScope ( CodeBase $code_base ) : Clazz
$code_base Phan\CodeBase The global code base holding all state
Результат Phan\Language\Element\Clazz Get the class in this scope, or fail real hard

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

public getElementInScope ( CodeBase $code_base ) : TypedElement
$code_base Phan\CodeBase The code base from which to retrieve the TypedElement
Результат 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() публичный Метод

*

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

public getFunctionLikeInScope ( CodeBase $code_base ) : Phan\Language\Element\FunctionInterface
$code_base Phan\CodeBase The global code base holding all state
Результат Phan\Language\Element\FunctionInterface Get the method in this scope or fail real hard

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

public getIsStrictTypes ( ) : boolean
Результат boolean True if strict_types is set to 1 in this context.

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

public getNamespace ( ) : string
Результат string The namespace of the file

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

public getNamespaceMapFor ( integer $flags, string $name ) : FullyQualifiedGlobalStructuralElement
$flags integer
$name string
Результат Phan\Language\FQSEN\FullyQualifiedGlobalStructuralElement The namespace mapped name for the given flags and name

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

public getScope ( ) : Scope
Результат Scope An object describing the contents of the current scope.

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

public getScope ( ) : Scope
Результат Scope An object describing the contents of the current scope.

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

public hasNamespaceMapFor ( integer $flags, string $name ) : boolean
$flags integer
$name string
Результат boolean True if we have a mapped NS for the given named element

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

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
Результат boolean True if issues with the given name are suppressed within this context.

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

public isInClassScope ( ) : boolean
Результат boolean True if this context is currently within a class scope, else false.

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

public isInElementScope ( ) : boolean
Результат 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 isInFunctionLikeScope ( ) : boolean
Результат boolean True if this context is currently within a method, function or closure scope.

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

public isInGlobalScope ( ) : boolean
Результат boolean True if we're in the global scope (not in a class, method, function, closure).

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

public isInMethodScope ( ) : boolean
Результат boolean True if this context is currently within a method.

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

Set the scope on the context
public setScope ( Scope $scope ) : void
$scope Scope
Результат void

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

Set the scope on the context
public setScope ( Scope $scope ) : void
$scope Scope
Результат void

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

*
public withNamespace ( string $namespace ) : Context
$namespace string The namespace of the file
Результат Context A clone of this context with the given value is returned

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

public withNamespaceMap ( integer $flags, string $alias, FullyQualifiedGlobalStructuralElement $target ) : Context
$flags integer
$alias string
$target Phan\Language\FQSEN\FullyQualifiedGlobalStructuralElement
Результат Context This context with the given value is returned

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

public withScope ( Scope $scope ) : Context
$scope Scope
Результат Context A new context with the given scope

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

public withScope ( Scope $scope ) : Context
$scope Scope
Результат Context A new context with the given scope

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

public withScopeVariable ( Variable $variable ) : Context
$variable Phan\Language\Element\Variable A variable to add to the scope for the new context
Результат Context A new context based on this with a variable as defined by the parameters in scope

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

public withStrictTypes ( integer $strict_types ) : Context
$strict_types integer The strict_type setting for the file
Результат Context This context with the given value is returned

Описание свойств

$strict_types защищенное свойство

strict_types setting for the file
protected int $strict_types
Результат integer