Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / nikic / php-parser / lib / PhpParser / Node / Expr / MethodCall.php
index a6cdd07c1ac328d47957db085dce740540e225e2..e0fe327101c53235bb6f16cb0ac18cde9e0f575f 100644 (file)
@@ -1,15 +1,16 @@
-<?php
+<?php declare(strict_types=1);
 
 namespace PhpParser\Node\Expr;
 
 use PhpParser\Node\Arg;
 use PhpParser\Node\Expr;
+use PhpParser\Node\Identifier;
 
 class MethodCall extends Expr
 {
     /** @var Expr Variable holding object */
     public $var;
-    /** @var string|Expr Method name */
+    /** @var Identifier|Expr Method name */
     public $name;
     /** @var Arg[] Arguments */
     public $args;
@@ -17,19 +18,23 @@ class MethodCall extends Expr
     /**
      * Constructs a function call node.
      *
-     * @param Expr        $var        Variable holding object
-     * @param string|Expr $name       Method name
-     * @param Arg[]       $args       Arguments
-     * @param array       $attributes Additional attributes
+     * @param Expr                   $var        Variable holding object
+     * @param string|Identifier|Expr $name       Method name
+     * @param Arg[]                  $args       Arguments
+     * @param array                  $attributes Additional attributes
      */
-    public function __construct(Expr $var, $name, array $args = array(), array $attributes = array()) {
+    public function __construct(Expr $var, $name, array $args = [], array $attributes = []) {
         parent::__construct($attributes);
         $this->var = $var;
-        $this->name = $name;
+        $this->name = \is_string($name) ? new Identifier($name) : $name;
         $this->args = $args;
     }
 
-    public function getSubNodeNames() {
-        return array('var', 'name', 'args');
+    public function getSubNodeNames() : array {
+        return ['var', 'name', 'args'];
+    }
+    
+    public function getType() : string {
+        return 'Expr_MethodCall';
     }
 }