Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / nikic / php-parser / lib / PhpParser / Node / Stmt / Interface_.php
index efb5891fcc8a078bdc91988de3f069153410e9c4..39049aae7a3f02e2e3a848ccb8f09fd4bb31633d 100644 (file)
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
 
 namespace PhpParser\Node\Stmt;
 
@@ -12,20 +12,24 @@ class Interface_ extends ClassLike
     /**
      * Constructs a class node.
      *
-     * @param string $name       Name
+     * @param string|Node\Identifier $name Name
      * @param array  $subNodes   Array of the following optional subnodes:
      *                           'extends' => array(): Name of extended interfaces
      *                           'stmts'   => array(): Statements
      * @param array  $attributes Additional attributes
      */
-    public function __construct($name, array $subNodes = array(), array $attributes = array()) {
+    public function __construct($name, array $subNodes = [], array $attributes = []) {
         parent::__construct($attributes);
-        $this->name = $name;
-        $this->extends = isset($subNodes['extends']) ? $subNodes['extends'] : array();
-        $this->stmts = isset($subNodes['stmts']) ? $subNodes['stmts'] : array();
+        $this->name = \is_string($name) ? new Node\Identifier($name) : $name;
+        $this->extends = $subNodes['extends'] ?? [];
+        $this->stmts = $subNodes['stmts'] ?? [];
     }
 
-    public function getSubNodeNames() {
-        return array('name', 'extends', 'stmts');
+    public function getSubNodeNames() : array {
+        return ['name', 'extends', 'stmts'];
+    }
+    
+    public function getType() : string {
+        return 'Stmt_Interface';
     }
 }