/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/UseStatementPass.php (4356B)
name) === \strtolower($this->lastNamespace)) { $this->aliases = $this->lastAliases; } } } /** * If this statement is a namespace, forget all the aliases we had. * * If it's a use statement, remember the alias for later. Otherwise, apply * remembered aliases to the code. * * @param Node $node */ public function leaveNode(Node $node) { // Store a reference to every "use" statement, because we'll need them in a bit. if ($node instanceof Use_) { foreach ($node->uses as $use) { $alias = $use->alias ?: \end($use->name->parts); $this->aliases[\strtolower($alias)] = $use->name; } return NodeTraverser::REMOVE_NODE; } // Expand every "use" statement in the group into a full, standalone "use" and store 'em with the others. if ($node instanceof GroupUse) { foreach ($node->uses as $use) { $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'), ]); } return NodeTraverser::REMOVE_NODE; } // Start fresh, since we're done with this namespace. if ($node instanceof Namespace_) { $this->lastNamespace = $node->name; $this->lastAliases = $this->aliases; $this->aliases = []; return; } // Do nothing with UseUse; this an entry in the list of uses in the use statement. if ($node instanceof UseUse) { return; } // For everything else, we'll implicitly thunk all aliases into fully-qualified names. foreach ($node as $name => $subNode) { if ($subNode instanceof Name) { if ($replacement = $this->findAlias($subNode)) { $node->$name = $replacement; } } } return $node; } /** * Find class/namespace aliases. * * @param Name $name * * @return FullyQualifiedName|null */ private function findAlias(Name $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))); } } } }