Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / nikic / php-parser / lib / PhpParser / Node / Stmt / If_.php
index 98bda356f62b3b70c608fa5cbbb0fea87cd0590d..87cd313b49eff3476afb18141bad89c2496e9644 100644 (file)
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
 
 namespace PhpParser\Node\Stmt;
 
@@ -8,7 +8,7 @@ class If_ extends Node\Stmt
 {
     /** @var Node\Expr Condition expression */
     public $cond;
-    /** @var Node[] Statements */
+    /** @var Node\Stmt[] Statements */
     public $stmts;
     /** @var ElseIf_[] Elseif clauses */
     public $elseifs;
@@ -25,15 +25,19 @@ class If_ extends Node\Stmt
      *                              'else'    => null   : Else clause
      * @param array     $attributes Additional attributes
      */
-    public function __construct(Node\Expr $cond, array $subNodes = array(), array $attributes = array()) {
+    public function __construct(Node\Expr $cond, array $subNodes = [], array $attributes = []) {
         parent::__construct($attributes);
         $this->cond = $cond;
-        $this->stmts = isset($subNodes['stmts']) ? $subNodes['stmts'] : array();
-        $this->elseifs = isset($subNodes['elseifs']) ? $subNodes['elseifs'] : array();
-        $this->else = isset($subNodes['else']) ? $subNodes['else'] : null;
+        $this->stmts = $subNodes['stmts'] ?? [];
+        $this->elseifs = $subNodes['elseifs'] ?? [];
+        $this->else = $subNodes['else'] ?? null;
     }
 
-    public function getSubNodeNames() {
-        return array('cond', 'stmts', 'elseifs', 'else');
+    public function getSubNodeNames() : array {
+        return ['cond', 'stmts', 'elseifs', 'else'];
+    }
+    
+    public function getType() : string {
+        return 'Stmt_If';
     }
 }