| 1 | <?php |
||
| 10 | abstract class ActionAbstract |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * Returns name of this action (possibly with some extra info). |
||
| 14 | * |
||
| 15 | * @return string |
||
| 16 | */ |
||
| 17 | abstract public function getName(); |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Throws an exception when action is not supported (eg: missing lib etc). |
||
| 21 | * |
||
| 22 | * @throws \Exception |
||
| 23 | */ |
||
| 24 | abstract public function checkSupport(); |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Execute action for the given parameters. |
||
| 28 | * |
||
| 29 | * @param InputInterface $input |
||
| 30 | * @param OutputInterface $output |
||
| 31 | */ |
||
| 32 | abstract public function execute(InputInterface $input, OutputInterface $output); |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @param InputInterface $input |
||
| 36 | * @param OutputInterface $output |
||
| 37 | * @param int $steps |
||
| 38 | * |
||
| 39 | * @return ProgressBar |
||
| 40 | */ |
||
| 41 | protected function createProgressBar(InputInterface $input, OutputInterface $output, $steps) |
||
| 52 | } |
||
| 53 |
For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a
@returndoc comment to communicate to implementors of these methods what they are expected to return.