Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / nikic / php-parser / lib / PhpParser / Node / Stmt / PropertyProperty.php
index b2d29dc77deb6babc020831f00dcfb6d144b8246..45e26faafde3f768a8a7bd9af6cf21ca4762e103 100644 (file)
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
 
 namespace PhpParser\Node\Stmt;
 
@@ -6,7 +6,7 @@ use PhpParser\Node;
 
 class PropertyProperty extends Node\Stmt
 {
-    /** @var string Name */
+    /** @var Node\VarLikeIdentifier Name */
     public $name;
     /** @var null|Node\Expr Default */
     public $default;
@@ -14,17 +14,21 @@ class PropertyProperty extends Node\Stmt
     /**
      * Constructs a class property node.
      *
-     * @param string         $name       Name
-     * @param null|Node\Expr $default    Default value
-     * @param array          $attributes Additional attributes
+     * @param string|Node\VarLikeIdentifier $name       Name
+     * @param null|Node\Expr                $default    Default value
+     * @param array                         $attributes Additional attributes
      */
-    public function __construct($name, Node\Expr $default = null, array $attributes = array()) {
+    public function __construct($name, Node\Expr $default = null, array $attributes = []) {
         parent::__construct($attributes);
-        $this->name = $name;
+        $this->name = \is_string($name) ? new Node\VarLikeIdentifier($name) : $name;
         $this->default = $default;
     }
 
-    public function getSubNodeNames() {
-        return array('name', 'default');
+    public function getSubNodeNames() : array {
+        return ['name', 'default'];
+    }
+    
+    public function getType() : string {
+        return 'Stmt_PropertyProperty';
     }
 }