PHP 클래스 Trismegiste\Mondrian\Transform\ReflectionContext

Responsible for maintaining a list of methods, traits, classes and interfaces used for building inheritance links in a digraph
파일 보기 프로젝트 열기: trismegiste/mondrian

보호된 프로퍼티들

프로퍼티 타입 설명
$inheritanceMap array the symbol map

공개 메소드들

메소드 설명
__construct ( ) Build the context
addMethodToClass ( string $cls, string $method ) Add a method to its type with the current type for its default declaring type (after resolveSymbol, it changes)
findMethodInInheritanceTree ( string $cls, string $method ) : string Find if method is declared in superclass.
getClassesUsingTraitForDeclaringMethod ( string $fqcn, string $methodName ) : array Returns a list of all classes using a trait for declaring a given method
getDeclaringClass ( string $cls, string $meth ) : string Finds the FQCN of the first declaring class/interface of a method
hasDeclaringClass ( string $cls ) : boolean Search if a type (trait, class or interface) exists in the inheritanceMap
initClass ( $name )
initInterface ( $name )
initSymbol ( string $name, string $symbolType ) Initialize a new symbol
initTrait ( $name )
isInterface ( string $cls ) : boolean Is FQCN an interface ?
isTrait ( string $cls ) : boolean Is FQCN an interface ?
pushParentClass ( string $cls, string $parent ) Stacks a parent type for a type
pushUseTrait ( $cls, $useTrait )
resolveSymbol ( ) Resolve all methods inheritance, use by traits and declared

보호된 메소드들

메소드 설명
resolveMethodDeclaration ( ) Construct the inheritanceMap of method by resolving which class or interface first declares a method
resolveTraitUse ( )

비공개 메소드들

메소드 설명
recursivDeclaration ( $current, $m )

메소드 상세

__construct() 공개 메소드

Build the context
public __construct ( )

addMethodToClass() 공개 메소드

Add a method to its type with the current type for its default declaring type (after resolveSymbol, it changes)
public addMethodToClass ( string $cls, string $method )
$cls string
$method string

findMethodInInheritanceTree() 공개 메소드

Note1: Algo is DFS Note2: Must be called AFTER resolveSymbol Note3: this one is kewl, I don't know why it works at the first try
public findMethodInInheritanceTree ( string $cls, string $method ) : string
$cls string
$method string
리턴 string the class which first declares the method (or null)

getClassesUsingTraitForDeclaringMethod() 공개 메소드

Returns a list of all classes using a trait for declaring a given method
public getClassesUsingTraitForDeclaringMethod ( string $fqcn, string $methodName ) : array
$fqcn string FQCN of trait
$methodName string the imported method
리턴 array

getDeclaringClass() 공개 메소드

Finds the FQCN of the first declaring class/interface of a method
public getDeclaringClass ( string $cls, string $meth ) : string
$cls string subclass name
$meth string method name
리턴 string

hasDeclaringClass() 공개 메소드

Search if a type (trait, class or interface) exists in the inheritanceMap
public hasDeclaringClass ( string $cls ) : boolean
$cls string
리턴 boolean

initClass() 공개 메소드

public initClass ( $name )

initInterface() 공개 메소드

public initInterface ( $name )

initSymbol() 공개 메소드

Initialize a new symbol
public initSymbol ( string $name, string $symbolType )
$name string class or interface name
$symbolType string one of SYMBOL_ const

initTrait() 공개 메소드

public initTrait ( $name )

isInterface() 공개 메소드

Is FQCN an interface ?
public isInterface ( string $cls ) : boolean
$cls string FQCN
리턴 boolean

isTrait() 공개 메소드

Is FQCN an interface ?
public isTrait ( string $cls ) : boolean
$cls string FQCN
리턴 boolean

pushParentClass() 공개 메소드

Stacks a parent type for a type
public pushParentClass ( string $cls, string $parent )
$cls string the type
$parent string the parent type of $cls

pushUseTrait() 공개 메소드

public pushUseTrait ( $cls, $useTrait )

resolveMethodDeclaration() 보호된 메소드

(not vey efficient algo, I admit), it sux, it's redundent, I don't like it
protected resolveMethodDeclaration ( )

resolveSymbol() 공개 메소드

Resolve all methods inheritance, use by traits and declared
public resolveSymbol ( )

resolveTraitUse() 보호된 메소드

protected resolveTraitUse ( )

프로퍼티 상세

$inheritanceMap 보호되어 있는 프로퍼티

array the symbol map
protected $inheritanceMap