Mercurial > hg > cmmr2012-drupal-site
annotate vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/If_.php @ 5:12f9dff5fda9 tip
Update to Drupal core 8.7.1
| author | Chris Cannam |
|---|---|
| date | Thu, 09 May 2019 15:34:47 +0100 |
| parents | c75dbcec494b |
| children |
| rev | line source |
|---|---|
| Chris@0 | 1 <?php declare(strict_types=1); |
| Chris@0 | 2 |
| Chris@0 | 3 namespace PhpParser\Node\Stmt; |
| Chris@0 | 4 |
| Chris@0 | 5 use PhpParser\Node; |
| Chris@0 | 6 |
| Chris@0 | 7 class If_ extends Node\Stmt |
| Chris@0 | 8 { |
| Chris@0 | 9 /** @var Node\Expr Condition expression */ |
| Chris@0 | 10 public $cond; |
| Chris@0 | 11 /** @var Node\Stmt[] Statements */ |
| Chris@0 | 12 public $stmts; |
| Chris@0 | 13 /** @var ElseIf_[] Elseif clauses */ |
| Chris@0 | 14 public $elseifs; |
| Chris@0 | 15 /** @var null|Else_ Else clause */ |
| Chris@0 | 16 public $else; |
| Chris@0 | 17 |
| Chris@0 | 18 /** |
| Chris@0 | 19 * Constructs an if node. |
| Chris@0 | 20 * |
| Chris@0 | 21 * @param Node\Expr $cond Condition |
| Chris@0 | 22 * @param array $subNodes Array of the following optional subnodes: |
| Chris@0 | 23 * 'stmts' => array(): Statements |
| Chris@0 | 24 * 'elseifs' => array(): Elseif clauses |
| Chris@0 | 25 * 'else' => null : Else clause |
| Chris@0 | 26 * @param array $attributes Additional attributes |
| Chris@0 | 27 */ |
| Chris@0 | 28 public function __construct(Node\Expr $cond, array $subNodes = [], array $attributes = []) { |
| Chris@0 | 29 parent::__construct($attributes); |
| Chris@0 | 30 $this->cond = $cond; |
| Chris@0 | 31 $this->stmts = $subNodes['stmts'] ?? []; |
| Chris@0 | 32 $this->elseifs = $subNodes['elseifs'] ?? []; |
| Chris@0 | 33 $this->else = $subNodes['else'] ?? null; |
| Chris@0 | 34 } |
| Chris@0 | 35 |
| Chris@0 | 36 public function getSubNodeNames() : array { |
| Chris@0 | 37 return ['cond', 'stmts', 'elseifs', 'else']; |
| Chris@0 | 38 } |
| Chris@0 | 39 |
| Chris@0 | 40 public function getType() : string { |
| Chris@0 | 41 return 'Stmt_If'; |
| Chris@0 | 42 } |
| Chris@0 | 43 } |
