Properties

$graph

$graph : 

Type

$currentClass

$currentClass : 

Type

$currentMethod

$currentMethod : 

Type

$namespace

$namespace : null|\Trismegiste\Mondrian\Visitor\PHPParser_Node_Name

Type

null|\Trismegiste\Mondrian\Visitor\PHPParser_Node_Name — Current namespace

$aliases

$aliases : array

Type

array — Currently defined namespace and class aliases

$currentPhpFile

$currentPhpFile : 

current file

Type

$reflection

$reflection : 

Type

$vertexDict

$vertexDict : 

Type

Methods

enterNode()

enterNode(\PHPParser_Node  $node) 

Parameters

\PHPParser_Node $node

leaveNode()

leaveNode(\PHPParser_Node  $node) 

{@inheritDoc}

Parameters

\PHPParser_Node $node

beforeTraverse()

beforeTraverse(array  $nodes) 

Parameters

array $nodes

getDeclaringClass()

getDeclaringClass(string  $cls, string  $meth) : string

Finds the FQCN of the first declaring class/interface of a method

Parameters

string $cls

subclass name

string $meth

method name

Returns

string

isInterface()

isInterface(string  $cls) : boolean

Is FQCN an interface ?

Parameters

string $cls

FQCN

Returns

boolean

isTrait()

isTrait(string  $cls) : boolean

Is FQCN a trait ?

Parameters

string $cls

FQCN

Returns

boolean

findVertex()

findVertex(string  $type, string  $key) : \Trismegiste\Mondrian\Graph\Vertex

Find a vertex by its type and name

Parameters

string $type
string $key

Returns

\Trismegiste\Mondrian\Graph\Vertex

or null

findAllMethodSameName()

findAllMethodSameName(  $method) 

See Context

Parameters

$method

existsVertex()

existsVertex(  $type,   $key) 

See Context

Parameters

$type
$key

findMethodInInheritanceTree()

findMethodInInheritanceTree(  $cls,   $method) 

Check if the class exists before searching for the declaring class of the method, because class could be unknown, outside or code could be bugged

Parameters

$cls
$method

getClassesUsingTraitForDeclaringMethod()

getClassesUsingTraitForDeclaringMethod(string  $cls,   $method) : array

Returns a list of all classes using a trait for declaring a given method

Parameters

string $cls

FQCN of trait

$method

Returns

array

logFallbackCall()

logFallbackCall(  $class,   $method,   $called) 

Parameters

$class
$method
$called

getExcludedCall()

getExcludedCall(  $class,   $method) 

Parameters

$class
$method

enterClassNode()

enterClassNode(\PHPParser_Node_Stmt_Class  $node) 

{@inheritDoc}

Parameters

\PHPParser_Node_Stmt_Class $node

enterInterfaceNode()

enterInterfaceNode(\PHPParser_Node_Stmt_Interface  $node) 

{@inheritDoc}

Parameters

\PHPParser_Node_Stmt_Interface $node

enterTraitNode()

enterTraitNode(\PHPParser_Node_Stmt_Trait  $node) 

Parameters

\PHPParser_Node_Stmt_Trait $node

enterPublicMethodNode()

enterPublicMethodNode(\PHPParser_Node_Stmt_ClassMethod  $node) 

{@inheritDoc}

Parameters

\PHPParser_Node_Stmt_ClassMethod $node

getCurrentMethodIndex()

getCurrentMethodIndex() : string

the vertex name for a MethodVertex

Returns

string

extractAnnotation()

extractAnnotation(\PHPParser_Node_Stmt  $node) 

Extracts annotations in the comment of a statement and injects them in attribute of the node

Parameters

\PHPParser_Node_Stmt $node

resolveClassName()

resolveClassName(\PHPParser_Node_Name  $src) : \PHPParser_Node_Name|\PHPParser_Node_Name_FullyQualified

resolve the Name with current namespace and alias

Parameters

\PHPParser_Node_Name $src

Returns

\PHPParser_Node_Name|\PHPParser_Node_Name_FullyQualified

getNamespacedName()

getNamespacedName(\PHPParser_Node  $node) : string

Helper : get the FQCN of the given $node->name

Parameters

\PHPParser_Node $node

Returns

string

pushMethod()

pushMethod(\PHPParser_Node_Stmt_ClassMethod  $node,   $index = null) 

Adding a new vertex if the method is not already indexed Since it is a method, I'm also adding the parameters

Parameters

\PHPParser_Node_Stmt_ClassMethod $node
$index

pushImplementation()

pushImplementation(\PHPParser_Node_Stmt_ClassMethod  $node) 

Adding a new vertex if the implementation is not already indexed

Parameters

\PHPParser_Node_Stmt_ClassMethod $node

pushParameter()

pushParameter(string  $methodName, integer  $order) 

Add a parameter vertex. I must point out that I store the order of the parameter, not its name. Why ? Because, name can change accross inheritance tree. Therefore, it could fail the refactoring of the source from the digraph.

Parameters

string $methodName

like 'FQCN::method'

integer $order

enterTraitMethod()

enterTraitMethod(\PHPParser_Node_Stmt_ClassMethod  $node) 

Parameters

\PHPParser_Node_Stmt_ClassMethod $node

enterClassMethod()

enterClassMethod(\PHPParser_Node_Stmt_ClassMethod  $node) 

Parameters

\PHPParser_Node_Stmt_ClassMethod $node

enterInterfaceMethod()

enterInterfaceMethod(\PHPParser_Node_Stmt_ClassMethod  $node) 

Parameters

\PHPParser_Node_Stmt_ClassMethod $node