function If_::__construct
Constructs an if node.
Parameters
Node\Expr $cond Condition:
array{: stmts?: Node\Stmt[], elseifs?: ElseIf_[], else?: Else_|null, } $subNodes Array of the following optional subnodes: 'stmts' => array(): Statements 'elseifs' => array(): Elseif clauses 'else' => null : Else clause
array<string, mixed> $attributes Additional attributes:
File
-
vendor/
nikic/ php-parser/ lib/ PhpParser/ Node/ Stmt/ If_.php, line 31
Class
Namespace
PhpParser\Node\StmtCode
public function __construct(Node\Expr $cond, array $subNodes = [], array $attributes = []) {
$this->attributes = $attributes;
$this->cond = $cond;
$this->stmts = $subNodes['stmts'] ?? [];
$this->elseifs = $subNodes['elseifs'] ?? [];
$this->else = $subNodes['else'] ?? null;
}