use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Vivait\PromptableOptions\Command\PromptableOptionsTrait;
class PromptableCommand extends Command
{
use PromptableOptionsTrait;
protected function configure()
{
$this
->setName('promptable:demo')
->addPrompt(
'name',
['description' => 'Your name', ' 'name' => ['description' => 'Your name', 'ln(sprintf('Hello %s!', $name));
$age = $this->getConsoleOptionInput('age');
if ($age) {
$output->writeln(sprintf('You are %s years old', $age));
}
$occupation = $this->getConsoleOptionInput('occupation');
$output->writeln(sprintf('You are a %s!', $occupation));
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.