/home/techb158/ileadtechnology.com/SSM/vendor/psy/psysh/src/CodeCleaner
NameSizeModeActions
AbstractClassPass.php22000644editdlrm
AssignThisVariablePass.php10340644editdlrm
CalledClassPass.php23860644editdlrm
CallTimePassByReferencePass.php13910644editdlrm
CodeCleanerPass.php4150644editdlrm
EmptyArrayDimFetchPass.php12830644editdlrm
ExitPass.php7730644editdlrm
FinalClassPass.php16660644editdlrm
FunctionContextPass.php13390644editdlrm
FunctionReturnInWriteContextPass.php24980644editdlrm
ImplicitReturnPass.php42400644editdlrm
InstanceOfPass.php16040644editdlrm
LabelContextPass.php23560644editdlrm
LeavePsyshAlonePass.php9130644editdlrm
ListPass.php32820644editdlrm
LoopContextPass.php34760644editdlrm
MagicConstantsPass.php10680644editdlrm
NamespaceAwarePass.php18560644editdlrm
NamespacePass.php24160644editdlrm
NoReturnValue.php8700644editdlrm
PassableByReferencePass.php40240644editdlrm
RequirePass.php30350644editdlrm
StrictTypesPass.php27040644editdlrm
UseStatementPass.php43560644editdlrm
ValidClassNamePass.php121760644editdlrm
ValidConstantPass.php32020644editdlrm
ValidConstructorPass.php38840644editdlrm
ValidFunctionNamePass.php32390644editdlrm
Edit: /home/techb158/ileadtechnology.com/SSM/vendor/psy/psysh/src/CodeCleaner/ValidFunctionNamePass.php (3239B)
conditionalScopes++; } elseif ($node instanceof Function_) { $name = $this->getFullyQualifiedName($node->name); // @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); throw new FatalErrorException($msg, 0, E_ERROR, null, $node->getLine()); } } $this->currentScope[\strtolower($name)] = true; } } /** * Validate that function calls will succeed. * * @throws FatalErrorException if a function is redefined * @throws FatalErrorException if the function name is a string (not an expression) and is not defined * * @param Node $node */ public function leaveNode(Node $node) { if (self::isConditional($node)) { $this->conditionalScopes--; } elseif ($node instanceof FuncCall) { // 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); $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); throw new FatalErrorException($message, 0, E_ERROR, null, $node->getLine()); } } } } private static function isConditional(Node $node) { return $node instanceof If_ || $node instanceof While_ || $node instanceof Do_ || $node instanceof Switch_; } }