Security update for Core, with self-updated composer
[yaffs-website] / vendor / nikic / php-parser / lib / PhpParser / Builder / Trait_.php
index 153437d7941c1f5154414daee09b0a93ba6d72e1..7b004fa962e0325d8f778f3c6b81b7c76599f4b6 100644 (file)
@@ -8,6 +8,7 @@ use PhpParser\Node\Stmt;
 class Trait_ extends Declaration
 {
     protected $name;
+    protected $uses = array();
     protected $properties = array();
     protected $methods = array();
 
@@ -34,6 +35,8 @@ class Trait_ extends Declaration
             $this->properties[] = $stmt;
         } else if ($stmt instanceof Stmt\ClassMethod) {
             $this->methods[] = $stmt;
+        } else if ($stmt instanceof Stmt\TraitUse) {
+            $this->uses[] = $stmt;
         } else {
             throw new \LogicException(sprintf('Unexpected node of type "%s"', $stmt->getType()));
         }
@@ -49,7 +52,7 @@ class Trait_ extends Declaration
     public function getNode() {
         return new Stmt\Trait_(
             $this->name, array(
-                'stmts' => array_merge($this->properties, $this->methods)
+                'stmts' => array_merge($this->uses, $this->properties, $this->methods)
             ), $this->attributes
         );
     }