PHP Class Phan\AST\UnionTypeVisitor

Inheritance: extends Phan\Language\AST\KindVisitorImplementation
Show file Open project: etsy/phan Class Usage Examples

Public Methods

Method Description
__construct ( CodeBase $code_base, Context $context, boolean $should_catch_issue_exception = true )
unionTypeFromClassNode ( CodeBase $code_base, Context $context, ast\Node | mixed $node ) : UnionType
unionTypeFromNode ( CodeBase $code_base, Context $context, ast\Node | mixed $node, boolean $should_catch_issue_exception = true ) : UnionType
visit ( ast\Node $node ) : UnionType Default visitor for node kinds that do not have an overriding method
visitArray ( ast\Node $node ) : UnionType Visit a node with kind \ast\AST_ARRAY
visitAssign ( ast\Node $node ) : UnionType Visit a node with kind \ast\AST_ASSIGN
visitAssignRef ( ast\Node $node ) : UnionType Visit a node with kind \ast\AST_ASSIGN_REF
visitBinaryOp ( ast\Node $node ) : UnionType Visit a node with kind \ast\AST_BINARY_OP
visitCall ( ast\Node $node ) : UnionType Visit a node with kind \ast\AST_CALL
visitCast ( ast\Node $node ) : UnionType Visit a node with kind \ast\AST_CAST
visitClassConst ( ast\Node $node ) : UnionType Visit a node with kind \ast\AST_CLASS_CONST
visitClone ( ast\Node $node ) : UnionType Visit a node with kind \ast\AST_CLONE
visitClosure ( ast\Node\Decl $node ) : UnionType Visit a node with kind \ast\AST_CLOSURE
visitCoalesce ( ast\Node $node ) : UnionType Visit a node with kind \ast\AST_COALESCE
visitConditional ( ast\Node $node ) : UnionType Visit a node with kind \ast\AST_CONDITIONAL
visitConst ( ast\Node $node ) : UnionType Visit a node with kind \ast\AST_CONST
visitDim ( ast\Node $node ) : UnionType Visit a node with kind \ast\AST_DIM
visitEmpty ( ast\Node $node ) : UnionType Visit a node with kind \ast\AST_EMPTY
visitEncapsList ( ast\Node $node ) : UnionType Visit a node with kind \ast\AST_ENCAPS_LIST
visitGreater ( ast\Node $node ) : UnionType Visit a node with kind \ast\AST_GREATER
visitGreaterEqual ( ast\Node $node ) : UnionType Visit a node with kind \ast\AST_GREATER_EQUAL
visitIncludeOrEval ( ast\Node $node ) : UnionType Visit a node with kind \ast\AST_INCLUDE_OR_EVAL
visitInstanceOf ( ast\Node $node ) : UnionType Visit a node with kind \ast\AST_INSTANCEOF
visitIsset ( ast\Node $node ) : UnionType Visit a node with kind \ast\AST_ISSET
visitMagicConst ( ast\Node $node ) : UnionType Visit a node with kind \ast\AST_MAGIC_CONST
visitMethodCall ( ast\Node $node ) : UnionType Visit a node with kind \ast\AST_METHOD_CALL
visitName ( ast\Node $node ) : UnionType Visit a node with kind \ast\AST_NAME
visitNew ( ast\Node $node ) : UnionType Visit a node with kind \ast\AST_NEW
visitPostDec ( ast\Node $node ) : UnionType Visit a node with kind \ast\AST_POST_DEC
visitPostInc ( ast\Node $node ) : UnionType Visit a node with kind \ast\AST_POST_INC
visitPreDec ( ast\Node $node ) : UnionType Visit a node with kind \ast\AST_PRE_DEC
visitPreInc ( ast\Node $node ) : UnionType Visit a node with kind \ast\AST_PRE_INC
visitProp ( ast\Node $node ) : UnionType Visit a node with kind \ast\AST_PROP
visitShellExec ( ast\Node $node ) : UnionType Visit a node with kind \ast\AST_SHELL_EXEC
visitStaticCall ( ast\Node $node ) : UnionType Visit a node with kind \ast\AST_STATIC_CALL
visitStaticProp ( ast\Node $node ) : UnionType Visit a node with kind \ast\AST_STATIC_PROP
visitType ( ast\Node $node ) : UnionType Visit a node with kind \ast\AST_TYPE
visitUnaryMinus ( ast\Node $node ) : UnionType Visit a node with kind \ast\AST_UNARY_MINUS
visitUnaryOp ( ast\Node $node ) : UnionType Visit a node with kind \ast\AST_UNARY_OP
visitVar ( ast\Node $node ) : UnionType Visit a node with kind \ast\AST_VAR

Private Methods

Method Description
classListFromNode ( ast\Node $node ) : Generator | Clazz[]
visitClassNode ( ast\Node $node ) : UnionType *

Method Details

__construct() public method

public __construct ( CodeBase $code_base, Context $context, boolean $should_catch_issue_exception = true )
$code_base Phan\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
$should_catch_issue_exception boolean Set to true to cause loggable issues to be thrown instead of emitted as issues to the log.

unionTypeFromClassNode() public static method

public static unionTypeFromClassNode ( CodeBase $code_base, Context $context, ast\Node | mixed $node ) : UnionType
$code_base Phan\CodeBase The code base within which we're operating
$context Phan\Language\Context $context The context of the parser at the node for which we'd like to determine a type
$node ast\Node | mixed The node for which we'd like to determine its type
return Phan\Language\UnionType The UnionType associated with the given node in the given Context within the given CodeBase

unionTypeFromNode() public static method

public static unionTypeFromNode ( CodeBase $code_base, Context $context, ast\Node | mixed $node, boolean $should_catch_issue_exception = true ) : UnionType
$code_base Phan\CodeBase The code base within which we're operating
$context Phan\Language\Context $context The context of the parser at the node for which we'd like to determine a type
$node ast\Node | mixed The node for which we'd like to determine its type
$should_catch_issue_exception boolean Set to true to cause loggable issues to be thrown instead
return Phan\Language\UnionType The UnionType associated with the given node in the given Context within the given CodeBase

visit() public method

Default visitor for node kinds that do not have an overriding method
public visit ( ast\Node $node ) : UnionType
$node ast\Node An AST node we'd like to determine the UnionType for
return Phan\Language\UnionType The set of types associated with the given node

visitArray() public method

Visit a node with kind \ast\AST_ARRAY
public visitArray ( ast\Node $node ) : UnionType
$node ast\Node A node of the type indicated by the method name that we'd like to figure out the type that it produces.
return Phan\Language\UnionType The set of types that are possibly produced by the given node

visitAssign() public method

Visit a node with kind \ast\AST_ASSIGN
public visitAssign ( ast\Node $node ) : UnionType
$node ast\Node A node of the type indicated by the method name that we'd like to figure out the type that it produces.
return Phan\Language\UnionType The set of types that are possibly produced by the given node

visitAssignRef() public method

Visit a node with kind \ast\AST_ASSIGN_REF
public visitAssignRef ( ast\Node $node ) : UnionType
$node ast\Node A node of the type indicated by the method name that we'd like to figure out the type that it produces.
return Phan\Language\UnionType The set of types that are possibly produced by the given node

visitBinaryOp() public method

Visit a node with kind \ast\AST_BINARY_OP
public visitBinaryOp ( ast\Node $node ) : UnionType
$node ast\Node A node of the type indicated by the method name that we'd like to figure out the type that it produces.
return Phan\Language\UnionType The set of types that are possibly produced by the given node

visitCall() public method

Visit a node with kind \ast\AST_CALL
public visitCall ( ast\Node $node ) : UnionType
$node ast\Node A node of the type indicated by the method name that we'd like to figure out the type that it produces.
return Phan\Language\UnionType The set of types that are possibly produced by the given node

visitCast() public method

Visit a node with kind \ast\AST_CAST
public visitCast ( ast\Node $node ) : UnionType
$node ast\Node A node of the type indicated by the method name that we'd like to figure out the type that it produces.
return Phan\Language\UnionType The set of types that are possibly produced by the given node

visitClassConst() public method

Visit a node with kind \ast\AST_CLASS_CONST
public visitClassConst ( ast\Node $node ) : UnionType
$node ast\Node A node of the type indicated by the method name that we'd like to figure out the type that it produces.
return Phan\Language\UnionType The set of types that are possibly produced by the given node

visitClone() public method

Visit a node with kind \ast\AST_CLONE
public visitClone ( ast\Node $node ) : UnionType
$node ast\Node A node of the type indicated by the method name that we'd like to figure out the type that it produces.
return Phan\Language\UnionType The set of types that are possibly produced by the given node

visitClosure() public method

Visit a node with kind \ast\AST_CLOSURE
public visitClosure ( ast\Node\Decl $node ) : UnionType
$node ast\Node\Decl A node of the type indicated by the method name that we'd like to figure out the type that it produces.
return Phan\Language\UnionType The set of types that are possibly produced by the given node

visitCoalesce() public method

Visit a node with kind \ast\AST_COALESCE
public visitCoalesce ( ast\Node $node ) : UnionType
$node ast\Node A node of the type indicated by the method name that we'd like to figure out the type that it produces.
return Phan\Language\UnionType The set of types that are possibly produced by the given node

visitConditional() public method

Visit a node with kind \ast\AST_CONDITIONAL
public visitConditional ( ast\Node $node ) : UnionType
$node ast\Node A node of the type indicated by the method name that we'd like to figure out the type that it produces.
return Phan\Language\UnionType The set of types that are possibly produced by the given node

visitConst() public method

Visit a node with kind \ast\AST_CONST
public visitConst ( ast\Node $node ) : UnionType
$node ast\Node A node of the type indicated by the method name that we'd like to figure out the type that it produces.
return Phan\Language\UnionType The set of types that are possibly produced by the given node

visitDim() public method

Visit a node with kind \ast\AST_DIM
public visitDim ( ast\Node $node ) : UnionType
$node ast\Node A node of the type indicated by the method name that we'd like to figure out the type that it produces.
return Phan\Language\UnionType The set of types that are possibly produced by the given node

visitEmpty() public method

Visit a node with kind \ast\AST_EMPTY
public visitEmpty ( ast\Node $node ) : UnionType
$node ast\Node A node of the type indicated by the method name that we'd like to figure out the type that it produces.
return Phan\Language\UnionType The set of types that are possibly produced by the given node

visitEncapsList() public method

Visit a node with kind \ast\AST_ENCAPS_LIST
public visitEncapsList ( ast\Node $node ) : UnionType
$node ast\Node A node of the type indicated by the method name that we'd like to figure out the type that it produces.
return Phan\Language\UnionType The set of types that are possibly produced by the given node

visitGreater() public method

Visit a node with kind \ast\AST_GREATER
public visitGreater ( ast\Node $node ) : UnionType
$node ast\Node A node of the type indicated by the method name that we'd like to figure out the type that it produces.
return Phan\Language\UnionType The set of types that are possibly produced by the given node

visitGreaterEqual() public method

Visit a node with kind \ast\AST_GREATER_EQUAL
public visitGreaterEqual ( ast\Node $node ) : UnionType
$node ast\Node A node of the type indicated by the method name that we'd like to figure out the type that it produces.
return Phan\Language\UnionType The set of types that are possibly produced by the given node

visitIncludeOrEval() public method

Visit a node with kind \ast\AST_INCLUDE_OR_EVAL
public visitIncludeOrEval ( ast\Node $node ) : UnionType
$node ast\Node A node of the type indicated by the method name that we'd like to figure out the type that it produces.
return Phan\Language\UnionType The set of types that are possibly produced by the given node

visitInstanceOf() public method

Visit a node with kind \ast\AST_INSTANCEOF
public visitInstanceOf ( ast\Node $node ) : UnionType
$node ast\Node A node of the type indicated by the method name that we'd like to figure out the type that it produces.
return Phan\Language\UnionType The set of types that are possibly produced by the given node

visitIsset() public method

Visit a node with kind \ast\AST_ISSET
public visitIsset ( ast\Node $node ) : UnionType
$node ast\Node A node of the type indicated by the method name that we'd like to figure out the type that it produces.
return Phan\Language\UnionType The set of types that are possibly produced by the given node

visitMagicConst() public method

Visit a node with kind \ast\AST_MAGIC_CONST
public visitMagicConst ( ast\Node $node ) : UnionType
$node ast\Node A node of the type indicated by the method name that we'd like to figure out the type that it produces.
return Phan\Language\UnionType The set of types that are possibly produced by the given node

visitMethodCall() public method

Visit a node with kind \ast\AST_METHOD_CALL
public visitMethodCall ( ast\Node $node ) : UnionType
$node ast\Node A node of the type indicated by the method name that we'd like to figure out the type that it produces.
return Phan\Language\UnionType The set of types that are possibly produced by the given node

visitName() public method

Visit a node with kind \ast\AST_NAME
public visitName ( ast\Node $node ) : UnionType
$node ast\Node A node of the type indicated by the method name that we'd like to figure out the type that it produces.
return Phan\Language\UnionType The set of types that are possibly produced by the given node

visitNew() public method

Visit a node with kind \ast\AST_NEW
public visitNew ( ast\Node $node ) : UnionType
$node ast\Node A node of the type indicated by the method name that we'd like to figure out the type that it produces.
return Phan\Language\UnionType The set of types that are possibly produced by the given node

visitPostDec() public method

Visit a node with kind \ast\AST_POST_DEC
public visitPostDec ( ast\Node $node ) : UnionType
$node ast\Node A node of the type indicated by the method name that we'd like to figure out the type that it produces.
return Phan\Language\UnionType The set of types that are possibly produced by the given node

visitPostInc() public method

Visit a node with kind \ast\AST_POST_INC
public visitPostInc ( ast\Node $node ) : UnionType
$node ast\Node A node of the type indicated by the method name that we'd like to figure out the type that it produces.
return Phan\Language\UnionType The set of types that are possibly produced by the given node

visitPreDec() public method

Visit a node with kind \ast\AST_PRE_DEC
public visitPreDec ( ast\Node $node ) : UnionType
$node ast\Node A node of the type indicated by the method name that we'd like to figure out the type that it produces.
return Phan\Language\UnionType The set of types that are possibly produced by the given node

visitPreInc() public method

Visit a node with kind \ast\AST_PRE_INC
public visitPreInc ( ast\Node $node ) : UnionType
$node ast\Node A node of the type indicated by the method name that we'd like to figure out the type that it produces.
return Phan\Language\UnionType The set of types that are possibly produced by the given node

visitProp() public method

Visit a node with kind \ast\AST_PROP
public visitProp ( ast\Node $node ) : UnionType
$node ast\Node A node of the type indicated by the method name that we'd like to figure out the type that it produces.
return Phan\Language\UnionType The set of types that are possibly produced by the given node

visitShellExec() public method

Visit a node with kind \ast\AST_SHELL_EXEC
public visitShellExec ( ast\Node $node ) : UnionType
$node ast\Node A node of the type indicated by the method name that we'd like to figure out the type that it produces.
return Phan\Language\UnionType The set of types that are possibly produced by the given node

visitStaticCall() public method

Visit a node with kind \ast\AST_STATIC_CALL
public visitStaticCall ( ast\Node $node ) : UnionType
$node ast\Node A node of the type indicated by the method name that we'd like to figure out the type that it produces.
return Phan\Language\UnionType The set of types that are possibly produced by the given node

visitStaticProp() public method

Visit a node with kind \ast\AST_STATIC_PROP
public visitStaticProp ( ast\Node $node ) : UnionType
$node ast\Node A node of the type indicated by the method name that we'd like to figure out the type that it produces.
return Phan\Language\UnionType The set of types that are possibly produced by the given node

visitType() public method

Visit a node with kind \ast\AST_TYPE
public visitType ( ast\Node $node ) : UnionType
$node ast\Node A node of the type indicated by the method name that we'd like to figure out the type that it produces.
return Phan\Language\UnionType The set of types that are possibly produced by the given node

visitUnaryMinus() public method

Visit a node with kind \ast\AST_UNARY_MINUS
public visitUnaryMinus ( ast\Node $node ) : UnionType
$node ast\Node A node of the type indicated by the method name that we'd like to figure out the type that it produces.
return Phan\Language\UnionType The set of types that are possibly produced by the given node

visitUnaryOp() public method

Visit a node with kind \ast\AST_UNARY_OP
public visitUnaryOp ( ast\Node $node ) : UnionType
$node ast\Node A node of the type indicated by the method name that we'd like to figure out the type that it produces.
return Phan\Language\UnionType The set of types that are possibly produced by the given node

visitVar() public method

Visit a node with kind \ast\AST_VAR
public visitVar ( ast\Node $node ) : UnionType
$node ast\Node A node of the type indicated by the method name that we'd like to figure out the type that it produces.
return Phan\Language\UnionType The set of types that are possibly produced by the given node