![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/rentpix.corals.io/vendor/laravel/envoy/src/Console/ |
<?php namespace Laravel\Envoy\Console; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Question\ConfirmationQuestion; use Symfony\Component\Console\Question\Question; trait Command { /** * The console command input. * * @var array */ protected $input; /** * The console command output. * * @var array */ protected $output; /** * Execute the command. * * @param \Symfony\Component\Console\Input\InputInterface $input * @param \Symfony\Component\Console\Output\OutputInterface $output * @return int */ public function execute(InputInterface $input, OutputInterface $output) { $this->input = $input; $this->output = $output; return (int) $this->fire(); } /** * Get an argument from the input. * * @param string $key * @return string */ public function argument($key) { return $this->input->getArgument($key); } /** * Get an option from the input. * * @param string $key * @return string */ public function option($key) { return $this->input->getOption($key); } /** * Ask the user the given question. * * @param string $question * @return string */ public function ask($question) { $question = '<comment>'.$question.'</comment> '; $question = new Question($question); return $this->getHelperSet()->get('question')->ask($this->input, $this->output, $question); } /** * Confirm the operation with the user. * * @param string $task * @param string $question * @return bool */ public function confirmTaskWithUser($task, $question) { $question = $question === true ? 'Are you sure you want to run the ['.$task.'] task?' : (string) $question; $question = '<comment>'.$question.' [y/N]:</comment> '; $question = new ConfirmationQuestion($question, false); return $this->getHelperSet()->get('question')->ask($this->input, $this->output, $question); } /** * Ask the user the given secret question. * * @param string $question * @return string */ public function secret($question) { $question = '<comment>'.$question.'</comment> '; $question = new Question($question); $question->setHidden(true); $question->setHiddenFallback(false); return $this->getHelperSet()->get('question')->ask($this->input, $this->output, $question); } }