diff vendor/psy/psysh/src/CodeCleaner/UseStatementPass.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 5fb285c0d0e3
children
line wrap: on
line diff
--- a/vendor/psy/psysh/src/CodeCleaner/UseStatementPass.php	Tue Jul 10 15:07:59 2018 +0100
+++ b/vendor/psy/psysh/src/CodeCleaner/UseStatementPass.php	Thu Feb 28 13:21:36 2019 +0000
@@ -49,7 +49,7 @@
         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)) {
+            if (\strtolower($node->name) === \strtolower($this->lastNamespace)) {
                 $this->aliases = $this->lastAliases;
             }
         }
@@ -69,8 +69,8 @@
             // Store a reference to every "use" statement, because we'll need
             // them in a bit.
             foreach ($node->uses as $use) {
-                $alias = $use->alias ?: end($use->name->parts);
-                $this->aliases[strtolower($alias)] = $use->name;
+                $alias = $use->alias ?: \end($use->name->parts);
+                $this->aliases[\strtolower($alias)] = $use->name;
             }
 
             return NodeTraverser::REMOVE_NODE;
@@ -78,8 +78,8 @@
             // Expand every "use" statement in the group into a full, standalone
             // "use" and store 'em with the others.
             foreach ($node->uses as $use) {
-                $alias = $use->alias ?: end($use->name->parts);
-                $this->aliases[strtolower($alias)] = Name::concat($node->prefix, $use->name, [
+                $alias = $use->alias ?: \end($use->name->parts);
+                $this->aliases[\strtolower($alias)] = Name::concat($node->prefix, $use->name, [
                     'startLine' => $node->prefix->getAttribute('startLine'),
                     'endLine'   => $use->name->getAttribute('endLine'),
                 ]);
@@ -114,12 +114,12 @@
      */
     private function findAlias(Name $name)
     {
-        $that = strtolower($name);
+        $that = \strtolower($name);
         foreach ($this->aliases as $alias => $prefix) {
             if ($that === $alias) {
                 return new FullyQualifiedName($prefix->toString());
-            } elseif (substr($that, 0, strlen($alias) + 1) === $alias . '\\') {
-                return new FullyQualifiedName($prefix->toString() . substr($name, strlen($alias)));
+            } elseif (\substr($that, 0, \strlen($alias) + 1) === $alias . '\\') {
+                return new FullyQualifiedName($prefix->toString() . \substr($name, \strlen($alias)));
             }
         }
     }