\Trismegiste\Mondrian\VisitorNewContractCollector

NewContractCollector gather classe which needs to be refactor with a contract.

Adds the new interface so changes could be made to the current PhpFile

Summary

Methods
Properties
Constants
enterNode()
leaveNode()
beforeTraverse()
__construct()
No public properties found
No constants found
enterClassNode()
enterInterfaceNode()
enterTraitNode()
enterPublicMethodNode()
getCurrentMethodIndex()
extractAnnotation()
resolveClassName()
getNamespacedName()
$currentClass
$currentMethod
$namespace
$aliases
$currentPhpFile
$context
N/A
No private methods found
No private properties found
N/A

Properties

$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

$context

$context : 

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

enterClassNode()

enterClassNode(\PHPParser_Node_Stmt_Class  $node) 

Visits a class node

Parameters

\PHPParser_Node_Stmt_Class $node

enterInterfaceNode()

enterInterfaceNode(\PHPParser_Node_Stmt_Interface  $node) 

do nothing

Parameters

\PHPParser_Node_Stmt_Interface $node

enterTraitNode()

enterTraitNode(\PHPParser_Node_Stmt_Trait  $node) 

do nothing

Parameters

\PHPParser_Node_Stmt_Trait $node

enterPublicMethodNode()

enterPublicMethodNode(\PHPParser_Node_Stmt_ClassMethod  $node) 

do nothing

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