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
Example #1
0
 /**
  * @param Context $context
  * @param CodeBase $code_base
  * @param Node|string|null $node
  *
  * @return UnionType
  *
  * @see \Phan\Deprecated\Pass2::node_type
  * Formerly 'function node_type'
  */
 public static function fromNode(Context $context, CodeBase $code_base, $node) : UnionType
 {
     return UnionTypeVisitor::unionTypeFromNode($code_base, $context, $node);
 }
Example #2
0
 /**
  * @param Context $context
  * The context of the parser at the node for which we'd
  * like to determine a type
  *
  * @param CodeBase $code_base
  * The code base within which we're operating
  *
  * @param Node|string|null $node
  * The node for which we'd like to determine its type
  *
  * @param bool $should_catch_issue_exception
  * Set to true to cause loggable issues to be thrown
  * instead of emitted as issues to the log.
  *
  * @return UnionType
  *
  * @throws IssueException
  * If $should_catch_issue_exception is false an IssueException may
  * be thrown for optional issues.
  */
 public static function fromNode(Context $context, CodeBase $code_base, $node, bool $should_catch_issue_exception = true) : UnionType
 {
     return UnionTypeVisitor::unionTypeFromNode($code_base, $context, $node, $should_catch_issue_exception);
 }