Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. If_.php

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

If_

Namespace

PhpParser\Node\Stmt

Code

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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal