| 1 | <?php |
||
| 18 | abstract class Task extends BaseObject |
||
| 19 | { |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Call before run task for setting up environment. |
||
| 23 | */ |
||
| 24 | abstract public function configure(): void; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Task executable. |
||
| 28 | * |
||
| 29 | * @return mixed |
||
| 30 | */ |
||
| 31 | abstract public function run(); |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Magic call in child runtime process. |
||
| 35 | * |
||
| 36 | * @return mixed result of this task. |
||
| 37 | * @see [[run()]] |
||
| 38 | */ |
||
| 39 | public function __invoke() |
||
| 45 | |||
| 46 | } |
||
| 47 |