PHP Class Phan\BlockAnalysisVisitor

Inheritance: extends Phan\AST\AnalysisVisitor
Show file Open project: etsy/phan

Public Methods

Method Description
__construct ( CodeBase $code_base, Context $context, ast\Node $parent_node = null, integer $depth )
__construct ( CodeBase $code_base, Context $context, ast\Node $parent_node = null, integer $depth )
visit ( ast\Node $node ) : Context For non-special nodes, we propagate the context and scope from the parent, through the children and return the modified scope
visitBranchedContext ( ast\Node $node ) : Context For nodes that are the root of mutually exclusive child nodes (if, try), we analyze each child in the parent context and then merge them together to try to guess what happens after the branching finishes.
visitCatchList ( ast\Node $node ) : Context
visitClass ( ast\Node\Decl $node ) : Context
visitClosedContext ( ast\Node $node ) : Context For 'closed context' items (classes, methods, functions, closures), we analyze children in the parent context, but then return the parent context itself unmodified by the children.
visitClosure ( ast\Node\Decl $node ) : Context
visitFuncDecl ( ast\Node\Decl $node ) : Context
visitIf ( ast\Node $node ) : Context
visitIfElem ( ast\Node $node ) : Context
visitMethod ( ast\Node\Decl $node ) : Context
visitTry ( ast\Node $node ) : Context

Method Details

__construct() public method

public __construct ( CodeBase $code_base, Context $context, ast\Node $parent_node = null, integer $depth )
$code_base CodeBase The code base within which we're operating
$context Phan\Language\Context The context of the parser at the node for which we'd like to determine a type
$parent_node ast\Node The parent of the node being analyzed
$depth integer The depth of the node being analyzed in the AST

__construct() public method

public __construct ( CodeBase $code_base, Context $context, ast\Node $parent_node = null, integer $depth )
$code_base CodeBase The code base within which we're operating
$context Phan\Language\Context The context of the parser at the node for which we'd like to determine a type
$parent_node ast\Node The parent of the node being analyzed
$depth integer The depth of the node being analyzed in the AST

visit() public method

│ ▼ ┌──● │ ●──●──● │ ●──┘ │ ▼
public visit ( ast\Node $node ) : Context
$node ast\Node An AST node we'd like to determine the UnionType for
return Phan\Language\Context The updated context after visiting the node

visitBranchedContext() public method

│ ▼ ┌──●──┐ │ │ │ ● ● ● │ │ │ └──●──┘ │ ▼
public visitBranchedContext ( ast\Node $node ) : Context
$node ast\Node An AST node we'd like to determine the UnionType for
return Phan\Language\Context The updated context after visiting the node

visitCatchList() public method

public visitCatchList ( ast\Node $node ) : Context
$node ast\Node An AST node we'd like to determine the UnionType for
return Phan\Language\Context The updated context after visiting the node

visitClass() public method

public visitClass ( ast\Node\Decl $node ) : Context
$node ast\Node\Decl An AST node we'd like to determine the UnionType for
return Phan\Language\Context The updated context after visiting the node

visitClosedContext() public method

│ ▼ ┌──●────┐ │ │ ●──●──● │ ┌────┘ ● │ ▼
public visitClosedContext ( ast\Node $node ) : Context
$node ast\Node An AST node we'd like to determine the UnionType for
return Phan\Language\Context The updated context after visiting the node

visitClosure() public method

public visitClosure ( ast\Node\Decl $node ) : Context
$node ast\Node\Decl An AST node we'd like to determine the UnionType for
return Phan\Language\Context The updated context after visiting the node

visitFuncDecl() public method

public visitFuncDecl ( ast\Node\Decl $node ) : Context
$node ast\Node\Decl An AST node we'd like to determine the UnionType for
return Phan\Language\Context The updated context after visiting the node

visitIf() public method

public visitIf ( ast\Node $node ) : Context
$node ast\Node An AST node we'd like to determine the UnionType for
return Phan\Language\Context The updated context after visiting the node

visitIfElem() public method

public visitIfElem ( ast\Node $node ) : Context
$node ast\Node An AST node we'd like to determine the UnionType for
return Phan\Language\Context The updated context after visiting the node

visitMethod() public method

public visitMethod ( ast\Node\Decl $node ) : Context
$node ast\Node\Decl An AST node we'd like to determine the UnionType for
return Phan\Language\Context The updated context after visiting the node

visitTry() public method

public visitTry ( ast\Node $node ) : Context
$node ast\Node An AST node we'd like to determine the UnionType for
return Phan\Language\Context The updated context after visiting the node