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