/var/www/cobraambalaj/vendor/psy/psysh/src/CodeCleaner
NameSizeModeActions
AbstractClassPass.php22020644editdlrm
AssignThisVariablePass.php10350644editdlrm
CalledClassPass.php23870644editdlrm
CallTimePassByReferencePass.php13920644editdlrm
CodeCleanerPass.php4150644editdlrm
EmptyArrayDimFetchPass.php12830644editdlrm
ExitPass.php7730644editdlrm
FinalClassPass.php16670644editdlrm
FunctionContextPass.php13400644editdlrm
FunctionReturnInWriteContextPass.php25010644editdlrm
ImplicitReturnPass.php42400644editdlrm
InstanceOfPass.php18780644editdlrm
IssetPass.php13220644editdlrm
LabelContextPass.php23570644editdlrm
LeavePsyshAlonePass.php9130644editdlrm
ListPass.php32830644editdlrm
LoopContextPass.php34800644editdlrm
MagicConstantsPass.php10680644editdlrm
NamespaceAwarePass.php18530644editdlrm
NamespacePass.php24160644editdlrm
NoReturnValue.php8700644editdlrm
PassableByReferencePass.php40260644editdlrm
RequirePass.php45650644editdlrm
ReturnTypePass.php34650644editdlrm
StrictTypesPass.php27060644editdlrm
UseStatementPass.php43360644editdlrm
ValidClassNamePass.php124330644editdlrm
ValidConstantPass.php32030644editdlrm
ValidConstructorPass.php38860644editdlrm
ValidFunctionNamePass.php32380644editdlrm
Edit: /var/www/cobraambalaj/vendor/psy/psysh/src/CodeCleaner/UseStatementPass.php (4336B)
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))); } } } }