X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fpsy%2Fpsysh%2Fsrc%2FCodeCleaner%2FValidFunctionNamePass.php;fp=vendor%2Fpsy%2Fpsysh%2Fsrc%2FCodeCleaner%2FValidFunctionNamePass.php;h=dd1e057630a13a3c2760e048199d7a90a3055bc6;hp=a6bf01e722aa857ce1d5c281f21ce9649b9773f6;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/vendor/psy/psysh/src/CodeCleaner/ValidFunctionNamePass.php b/vendor/psy/psysh/src/CodeCleaner/ValidFunctionNamePass.php index a6bf01e72..dd1e05763 100644 --- a/vendor/psy/psysh/src/CodeCleaner/ValidFunctionNamePass.php +++ b/vendor/psy/psysh/src/CodeCleaner/ValidFunctionNamePass.php @@ -49,14 +49,14 @@ class ValidFunctionNamePass extends NamespaceAwarePass // @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 @@ class ValidFunctionNamePass extends NamespaceAwarePass // 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()); } }