/home/techb158/dev.balacoffee.com/vendor/psy/psysh/src/Command
NameSizeModeActions
ListCommand/-0755rm
TimeitCommand/-0755rm
BufferCommand.php24850644editdlrm
ClearCommand.php11280644editdlrm
CodeArgumentParser.php15060644editdlrm
Command.php72770644editdlrm
DocCommand.php92490644editdlrm
DumpCommand.php26160644editdlrm
EditCommand.php58590644editdlrm
ExitCommand.php11530644editdlrm
HelpCommand.php28420644editdlrm
HistoryCommand.php76890644editdlrm
ListCommand.php98670644editdlrm
ParseCommand.php41270644editdlrm
PsyVersionCommand.php9530644editdlrm
ReflectingCommand.php112300644editdlrm
ShowCommand.php98730644editdlrm
SudoCommand.php31270644editdlrm
ThrowUpCommand.php37440644editdlrm
TimeitCommand.php50550644editdlrm
TraceCommand.php26960644editdlrm
WhereamiCommand.php43660644editdlrm
WtfCommand.php38520644editdlrm
Edit: /home/techb158/dev.balacoffee.com/vendor/psy/psysh/src/Command/SudoCommand.php (3127B)
parser = new CodeArgumentParser(); $this->traverser = new NodeTraverser(); $this->traverser->addVisitor(new SudoVisitor()); $this->printer = new Printer(); parent::__construct($name); } /** * Set the Shell's Readline service. * * @param Readline $readline */ public function setReadline(Readline $readline) { $this->readline = $readline; } /** * {@inheritdoc} */ protected function configure() { $this ->setName('sudo') ->setDefinition([ new CodeArgument('code', CodeArgument::REQUIRED, 'Code to execute.'), ]) ->setDescription('Evaluate PHP code, bypassing visibility restrictions.') ->setHelp( <<<'HELP' Evaluate PHP code, bypassing visibility restrictions. e.g. >>> $sekret->whisper("hi") PHP error: Call to private method Sekret::whisper() from context '' on line 1 >>> sudo $sekret->whisper("hi") => "hi" >>> $sekret->word PHP error: Cannot access private property Sekret::$word on line 1 >>> sudo $sekret->word => "hi" >>> $sekret->word = "please" PHP error: Cannot access private property Sekret::$word on line 1 >>> sudo $sekret->word = "please" => "please" HELP ); } /** * {@inheritdoc} * * @return int 0 if everything went fine, or an exit code */ protected function execute(InputInterface $input, OutputInterface $output) { $code = $input->getArgument('code'); // special case for !! if ($code === '!!') { $history = $this->readline->listHistory(); if (\count($history) < 2) { throw new \InvalidArgumentException('No previous command to replay'); } $code = $history[\count($history) - 2]; } $nodes = $this->traverser->traverse($this->parser->parse($code)); $sudoCode = $this->printer->prettyPrint($nodes); $shell = $this->getApplication(); $shell->addCode($sudoCode, !$shell->hasCode()); return 0; } }