Scope

io.joern.php2cpg.utils.Scope
class Scope(summary: Map[String, Seq[SymbolSummary]], closureNameFn: () => String) extends Scope[String, NewNode, TypedScopeElement]

Attributes

Graph
Supertypes
class Scope[String, NewNode, TypedScopeElement]
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def addAnonymousMethod(methodAst: Ast): Unit
def addConstOrStaticInitToScope(node: PhpNode, memberNode: NewMember, value: PhpExpr): Unit
def addFieldInitToScope(node: PhpNode, memberNode: NewMember, value: PhpExpr): Unit
def addMethodRef(methodRefName: String, methodRef: NewMethodRef): Unit
def addVariableToMethodScope(identifier: String, variable: NewNode, methodFullName: String): Option[MethodScope]
def createMethodNameWithSurroundingInformation(methodName: String): String
def getDeduplicatedClassName(className: String): String
def getDeduplicatedMethodName(methodName: String): String
def getEnclosingNamespaceNames: List[String]
def getEnclosingTypeDeclTypeFullName: Option[String]
def getEnclosingTypeDeclTypeName: Option[String]
def getFieldInits: List[PhpInit]
def getMethodRef(methodRefName: String): Option[NewMethodRef]
def getNewClassTmp: String
def getNewVarTmp(varPrefix: String): String
def getScopedClosureName: String
def isTopLevel: Boolean
override def popScope(): Option[TypedScopeElement]

Attributes

Definition Classes
Scope
override def pushNewScope(scopeNode: TypedScopeElement): Unit

Attributes

Definition Classes
Scope
def resolveIdentifier(symbol: String): Option[SymbolSummary]

Attempts to resolve a simple symbol.

Attempts to resolve a simple symbol.

Note: This will be extended to notify the caller if this identifier is instead a local variable.

Attributes

def surroundingAstLabel: Option[String]
def surroundingScopeFullName: Option[String]
def useFunctionDecl(name: String, fullName: String): Unit

Declares that the following function declaration has been defined and should now be considered in scope and resolvable by its name.

Declares that the following function declaration has been defined and should now be considered in scope and resolvable by its name.

Value parameters

fullName

the function full name.

name

the function name.

Attributes

def useImport(imports: Seq[NewImport]): Unit

Declares imports to load into this scope.

Declares imports to load into this scope.

Value parameters

imports

the import nodes generated from parsing PhpUseStmt and PhpGroupUseStmt nodes.

Attributes

def useTypeDecl(name: String, fullName: String): Unit

Declares that the following type declaration has been defined and should now be considered in scope and resolvable by its name.

Declares that the following type declaration has been defined and should now be considered in scope and resolvable by its name.

Value parameters

fullName

the type decl full name.

name

the type decl name.

Attributes

Inherited methods

def addToScope(identifier: String, variable: NewNode): TypedScopeElement

Attributes

Inherited from:
Scope
def isEmpty: Boolean

Attributes

Inherited from:
Scope
def lookupVariable(identifier: String): Option[NewNode]

Attributes

Inherited from:
Scope
def size: Int

Attributes

Inherited from:
Scope

Givens

Givens

given closureName: () => String