From bb74ea59cf527b3fe84324cf84efcf629ff13937 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Thu, 10 Jan 2019 13:00:09 +0000 Subject: [PATCH] Scaffold FetchTweetsCommand --- src/Command/FetchTweetsCommand.php | 40 ++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/Command/FetchTweetsCommand.php diff --git a/src/Command/FetchTweetsCommand.php b/src/Command/FetchTweetsCommand.php new file mode 100644 index 0000000..b0a11f4 --- /dev/null +++ b/src/Command/FetchTweetsCommand.php @@ -0,0 +1,40 @@ +setDescription('Add a short description for your command') + ->addArgument('arg1', InputArgument::OPTIONAL, 'Argument description') + ->addOption('option1', null, InputOption::VALUE_NONE, 'Option description') + ; + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $io = new SymfonyStyle($input, $output); + $arg1 = $input->getArgument('arg1'); + + if ($arg1) { + $io->note(sprintf('You passed an argument: %s', $arg1)); + } + + if ($input->getOption('option1')) { + // ... + } + + $io->success('You have a new command! Now make it your own! Pass --help to see your options.'); + } +}