/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/CalledClassPass.php (2387B)
inClass = false; } /** * @throws ErrorException if get_class or get_called_class is called without an object from outside a class * * @param Node $node */ public function enterNode(Node $node) { if ($node instanceof Class_ || $node instanceof Trait_) { $this->inClass = true; } elseif ($node instanceof FuncCall && !$this->inClass) { // We'll give any args at all (besides null) a pass. // Technically we should be checking whether the args are objects, but this will do for now. // // @todo switch this to actually validate args when we get context-aware code cleaner passes. if (!empty($node->args) && !$this->isNull($node->args[0])) { return; } // We'll ignore name expressions as well (things like `$foo()`) if (!($node->name instanceof Name)) { return; } $name = \strtolower($node->name); if (\in_array($name, ['get_class', 'get_called_class'])) { $msg = \sprintf('%s() called without object from outside a class', $name); throw new ErrorException($msg, 0, \E_USER_WARNING, null, $node->getLine()); } } } /** * @param Node $node */ public function leaveNode(Node $node) { if ($node instanceof Class_) { $this->inClass = false; } } private function isNull(Node $node) { return $node->value instanceof ConstFetch && \strtolower($node->value->name) === 'null'; } }