PHP Class Phan\Analysis\PreOrderAnalysisVisitor

Inheritance: extends ScopeVisitor
Show file Open project: etsy/phan

Public Methods

Method Description
__construct ( CodeBase $code_base, Context $context )
analyzeFunctionLikeIsGenerator ( ast\Node $node ) : boolean
analyzeNodeHasYield ( ast\Node $node )
visit ( ast\Node $node ) : Context
visitCall ( ast\Node $node ) : Context
visitCatch ( ast\Node $node ) : Context
visitClass ( ast\Node\Decl $node ) : Context Visit a node with kind \ast\AST_CLASS
visitClosure ( ast\Node\Decl $node ) : Context Visit a node with kind \ast\AST_CLOSURE
visitForeach ( ast\Node $node ) : Context
visitFuncDecl ( ast\Node\Decl $node ) : Context Visit a node with kind \ast\AST_FUNC_DECL
visitIfElem ( ast\Node $node ) : Context
visitMethod ( ast\Node\Decl $node ) : Context Visit a node with kind \ast\AST_METHOD

Private Methods

Method Description
getContextClass ( ) : Clazz
setReturnTypeOfGenerator ( Phan\Language\Element\FunctionInterface $func, ast\Node $node ) : void The return type of the given FunctionInterface to a Generator.

Method Details

__construct() public method

public __construct ( CodeBase $code_base, Context $context )
$code_base Phan\CodeBase
$context Phan\Language\Context The context of the parser at the node for which we'd like to determine a type

analyzeFunctionLikeIsGenerator() public static method

public static analyzeFunctionLikeIsGenerator ( ast\Node $node ) : boolean
$node ast\Node A node to parse This must be called before visitReturn is called within a function.
return boolean A new or an unchanged context resulting from parsing the node

analyzeNodeHasYield() public static method

public static analyzeNodeHasYield ( ast\Node $node )
$node ast\Node

visit() public method

public visit ( ast\Node $node ) : Context
$node ast\Node
return Phan\Language\Context

visitCall() public method

public visitCall ( ast\Node $node ) : Context
$node ast\Node A node to parse
return Phan\Language\Context A new or an unchanged context resulting from parsing the node

visitCatch() public method

public visitCatch ( ast\Node $node ) : Context
$node ast\Node A node to parse
return Phan\Language\Context A new or an unchanged context resulting from parsing the node

visitClass() public method

Visit a node with kind \ast\AST_CLASS
public visitClass ( ast\Node\Decl $node ) : Context
$node ast\Node\Decl A node to parse
return Phan\Language\Context A new or an unchanged context resulting from parsing the node

visitClosure() public method

Visit a node with kind \ast\AST_CLOSURE
public visitClosure ( ast\Node\Decl $node ) : Context
$node ast\Node\Decl A node to parse
return Phan\Language\Context A new or an unchanged context resulting from parsing the node

visitForeach() public method

public visitForeach ( ast\Node $node ) : Context
$node ast\Node A node to parse
return Phan\Language\Context A new or an unchanged context resulting from parsing the node

visitFuncDecl() public method

Visit a node with kind \ast\AST_FUNC_DECL
public visitFuncDecl ( ast\Node\Decl $node ) : Context
$node ast\Node\Decl A node to parse
return Phan\Language\Context A new or an unchanged context resulting from parsing the node

visitIfElem() public method

public visitIfElem ( ast\Node $node ) : Context
$node ast\Node A node to parse
return Phan\Language\Context A new or an unchanged context resulting from parsing the node

visitMethod() public method

Visit a node with kind \ast\AST_METHOD
public visitMethod ( ast\Node\Decl $node ) : Context
$node ast\Node\Decl A node to parse
return Phan\Language\Context A new or an unchanged context resulting from parsing the node