/** * @param CodeBase $code_base * The global code base we're operating within * * @param Context $context * The context of the parser at the node for which we'd * like to determine a type * * @param Node $assignment_node * The AST node containing the assignment * * @param UnionType $right_type * The type of the element on the right side of the assignment * * @param bool $is_dim_assignment * True if this assignment is to an array parameter such as * in `$foo[3] = 42`. We need to know this in order to decide * if we're replacing the union type or if we're adding a * type to the union type. */ public function __construct(CodeBase $code_base, Context $context, Node $assignment_node, UnionType $right_type, bool $is_dim_assignment = false) { parent::__construct($code_base, $context); $this->assignment_node = $assignment_node; $this->right_type = $right_type; $this->is_dim_assignment = $is_dim_assignment; }
public function __construct(CodeBase $code_base, Context $context, Plugin $plugin) { // After constructing on parent, `$code_base` and // `$context` will be available as protected properties // `$this->code_base` and `$this->context`. parent::__construct($code_base, $context); // We take the plugin so that we can call // `$this->plugin->emitIssue(...)` on it to emit issues // to the user. $this->plugin = $plugin; }
/** * @param CodeBase $code_base * The global code base holding all state * * @param Context $context * The context of the parser at the node for which we'd * like to determine a type */ public function __construct(CodeBase $code_base, Context $context) { parent::__construct($code_base, $context); }
/** * @param CodeBase $code_base * The code base within which we're operating * * @param Context $context * The context of the parser at the node for which we'd * like to determine a 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. */ public function __construct(CodeBase $code_base, Context $context, bool $should_catch_issue_exception = true) { parent::__construct($code_base, $context); $this->should_catch_issue_exception = $should_catch_issue_exception; }
/** * @param CodeBase $code_base * A code base needs to be passed in because we require * it to be initialized before any classes or files are * loaded. * * @param Context $context * The context of the parser at the node for which we'd * like to determine a type * * @param Node|null $parent_node * The parent node of the node being analyzed */ public function __construct(CodeBase $code_base, Context $context, Node $parent_node = null) { parent::__construct($code_base, $context); $this->parent_node = $parent_node; }
/** * @param CodeBase $code_base * The code base within which we're operating * * @param Context $context * The context of the parser at the node for which we'd * like to determine a type * * @param Node $parent_node * The parent of the node being analyzed * * @param int $depth * The depth of the node being analyzed in the AST */ public function __construct(CodeBase $code_base, Context $context, Node $parent_node = null, int $depth = 0) { parent::__construct($code_base, $context); $this->parent_node = $parent_node; $this->depth = $depth; }