| 1 | <?php |
||
| 7 | abstract class Command |
||
| 8 | { |
||
| 9 | /** @var \Symfony\Component\Console\Input\InputInterface */ |
||
| 10 | protected $input; |
||
| 11 | |||
| 12 | /** @var \Symfony\Component\Console\Output\OutputInterface */ |
||
| 13 | protected $output; |
||
| 14 | |||
| 15 | /** @var string */ |
||
| 16 | protected $description = ''; |
||
| 17 | |||
| 18 | /** @var string */ |
||
| 19 | protected $help = ''; |
||
| 20 | |||
| 21 | /** @var array */ |
||
| 22 | protected $arguments = []; |
||
| 23 | |||
| 24 | /** @var array */ |
||
| 25 | protected $options = []; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @param \Symfony\Component\Console\Input\InputInterface $input |
||
| 29 | * @param \Symfony\Component\Console\Output\OutputInterface $output |
||
| 30 | * @return \Wandu\Console\Command |
||
| 31 | */ |
||
| 32 | public function withIO(InputInterface $input, OutputInterface $output) |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @return string |
||
| 42 | */ |
||
| 43 | public function getDescription() |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @return string |
||
| 50 | */ |
||
| 51 | public function getHelp() |
||
| 55 | |||
| 56 | /** |
||
| 57 | * @return array |
||
| 58 | */ |
||
| 59 | public function getArguments() |
||
| 63 | |||
| 64 | /** |
||
| 65 | * @return array |
||
| 66 | */ |
||
| 67 | public function getOptions() |
||
| 71 | |||
| 72 | abstract function execute(); |
||
| 73 | } |
||
| 74 |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.