diff vendor/psy/psysh/src/CodeCleaner/ValidFunctionNamePass.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/ValidFunctionNamePass.php	Tue Jul 10 15:07:59 2018 +0100
+++ b/vendor/psy/psysh/src/CodeCleaner/ValidFunctionNamePass.php	Thu Feb 28 13:21:36 2019 +0000
@@ -49,14 +49,14 @@
             // @todo add an "else" here which adds a runtime check for instances where we can't tell
             // whether a function is being redefined by static analysis alone.
             if ($this->conditionalScopes === 0) {
-                if (function_exists($name) ||
-                    isset($this->currentScope[strtolower($name)])) {
-                    $msg = sprintf('Cannot redeclare %s()', $name);
+                if (\function_exists($name) ||
+                    isset($this->currentScope[\strtolower($name)])) {
+                    $msg = \sprintf('Cannot redeclare %s()', $name);
                     throw new FatalErrorException($msg, 0, E_ERROR, null, $node->getLine());
                 }
             }
 
-            $this->currentScope[strtolower($name)] = true;
+            $this->currentScope[\strtolower($name)] = true;
         }
     }
 
@@ -76,11 +76,11 @@
             // if function name is an expression or a variable, give it a pass for now.
             $name = $node->name;
             if (!$name instanceof Expr && !$name instanceof Variable) {
-                $shortName = implode('\\', $name->parts);
+                $shortName = \implode('\\', $name->parts);
                 $fullName  = $this->getFullyQualifiedName($name);
-                $inScope   = isset($this->currentScope[strtolower($fullName)]);
-                if (!$inScope && !function_exists($shortName) && !function_exists($fullName)) {
-                    $message = sprintf('Call to undefined function %s()', $name);
+                $inScope   = isset($this->currentScope[\strtolower($fullName)]);
+                if (!$inScope && !\function_exists($shortName) && !\function_exists($fullName)) {
+                    $message = \sprintf('Call to undefined function %s()', $name);
                     throw new FatalErrorException($message, 0, E_ERROR, null, $node->getLine());
                 }
             }