| 1 | <?php |
||
| 11 | abstract class ActionAbstract |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @var Config |
||
| 15 | */ |
||
| 16 | protected $config; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Returns name of this action (possibly with some extra info). |
||
| 20 | * |
||
| 21 | * @return string |
||
| 22 | */ |
||
| 23 | abstract public function getName(); |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Throws an exception when action is not supported (eg: missing lib etc). |
||
| 27 | * |
||
| 28 | * @throws \Exception |
||
| 29 | */ |
||
| 30 | abstract public function checkSupport(); |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Execute action for the given parameters. |
||
| 34 | * |
||
| 35 | * @param InputInterface $input |
||
| 36 | * @param OutputInterface $output |
||
| 37 | */ |
||
| 38 | abstract public function execute(InputInterface $input, OutputInterface $output); |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @param InputInterface $input |
||
| 42 | * @param OutputInterface $output |
||
| 43 | * @param int $steps |
||
| 44 | * |
||
| 45 | * @return ProgressBar |
||
| 46 | */ |
||
| 47 | 4 | protected function createProgressBar(InputInterface $input, OutputInterface $output, $steps) |
|
| 59 | |||
| 60 | /** |
||
| 61 | * @param Config $config |
||
| 62 | */ |
||
| 63 | 1 | public function setConfig(Config $config) |
|
| 67 | } |
||
| 68 |