Yaffs site version 1.1
[yaffs-website] / vendor / psy / psysh / src / Psy / CodeCleaner / UseStatementPass.php
index 93bc7cb70993ed1988ff75e53595978a59866283..c1ce64d3ea78a6286ca70d3626a46c08b06b1ddb 100644 (file)
@@ -14,9 +14,9 @@ namespace Psy\CodeCleaner;
 use PhpParser\Node;
 use PhpParser\Node\Name;
 use PhpParser\Node\Name\FullyQualified as FullyQualifiedName;
-use PhpParser\Node\Stmt\GroupUse as GroupUseStmt;
-use PhpParser\Node\Stmt\Namespace_ as NamespaceStmt;
-use PhpParser\Node\Stmt\Use_ as UseStmt;
+use PhpParser\Node\Stmt\GroupUse;
+use PhpParser\Node\Stmt\Namespace_;
+use PhpParser\Node\Stmt\Use_;
 
 /**
  * Provide implicit use statements for subsequent execution.
@@ -28,7 +28,7 @@ use PhpParser\Node\Stmt\Use_ as UseStmt;
  * ... which it then applies implicitly to all future evaluated code, until the
  * current namespace is replaced by another namespace.
  */
-class UseStatementPass extends NamespaceAwarePass
+class UseStatementPass extends CodeCleanerPass
 {
     private $aliases       = array();
     private $lastAliases   = array();
@@ -45,7 +45,7 @@ class UseStatementPass extends NamespaceAwarePass
      */
     public function enterNode(Node $node)
     {
-        if ($node instanceof NamespaceStmt) {
+        if ($node instanceof Namespace_) {
             // If this is the same namespace as last namespace, let's do ourselves
             // a favor and reload all the aliases...
             if (strtolower($node->name) === strtolower($this->lastNamespace)) {
@@ -64,7 +64,7 @@ class UseStatementPass extends NamespaceAwarePass
      */
     public function leaveNode(Node $node)
     {
-        if ($node instanceof UseStmt) {
+        if ($node instanceof Use_) {
             // Store a reference to every "use" statement, because we'll need
             // them in a bit.
             foreach ($node->uses as $use) {
@@ -72,7 +72,7 @@ class UseStatementPass extends NamespaceAwarePass
             }
 
             return false;
-        } elseif ($node instanceof GroupUseStmt) {
+        } elseif ($node instanceof GroupUse) {
             // Expand every "use" statement in the group into a full, standalone
             // "use" and store 'em with the others.
             foreach ($node->uses as $use) {
@@ -83,7 +83,7 @@ class UseStatementPass extends NamespaceAwarePass
             }
 
             return false;
-        } elseif ($node instanceof NamespaceStmt) {
+        } elseif ($node instanceof Namespace_) {
             // Start fresh, since we're done with this namespace.
             $this->lastNamespace = $node->name;
             $this->lastAliases   = $this->aliases;