1 | <?php |
||
15 | abstract class BaseCommand extends Command |
||
16 | { |
||
17 | |||
18 | /** |
||
19 | * Namespace for the command. |
||
20 | */ |
||
21 | const COMMAND_NAMESPACE = 'smartweb-testing'; |
||
22 | |||
23 | public function __construct() |
||
29 | |||
30 | /** |
||
31 | * Execute the console command. |
||
32 | * |
||
33 | * @return void |
||
34 | */ |
||
35 | abstract public function handle(); |
||
36 | |||
37 | /** |
||
38 | * @return CommandArguments |
||
39 | */ |
||
40 | abstract protected function provideArguments() : CommandArguments; |
||
41 | |||
42 | /** |
||
43 | * Get the value of a command option, with an optional fallback if the option is not set. |
||
44 | * |
||
45 | * @param string $key |
||
46 | * @param string|array $default |
||
47 | * |
||
48 | * @return string|array |
||
49 | */ |
||
50 | final protected function getOption(string $key, $default) |
||
56 | |||
57 | /** |
||
58 | * Get the console command arguments. |
||
59 | * |
||
60 | * @return array |
||
61 | */ |
||
62 | final protected function getArguments() |
||
66 | |||
67 | /** |
||
68 | * @return bool |
||
69 | */ |
||
70 | protected function nameIsNotConfigured() : bool |
||
74 | |||
75 | protected function configureName() |
||
84 | } |
||
85 |