1 | <?php |
||
11 | abstract class AbstractInitializeCommand extends Command |
||
12 | { |
||
13 | /** |
||
14 | * Execute the console command. |
||
15 | * |
||
16 | * @return void |
||
17 | */ |
||
18 | 210 | public function handle(Container $container) |
|
62 | |||
63 | /** |
||
64 | * Returns allowed options. |
||
65 | * |
||
66 | * @return string |
||
67 | */ |
||
68 | protected function getOptionsConfig(Container $container) |
||
69 | { |
||
70 | $config = $container->make('config'); |
||
71 | $options = $config->get($config->get('initializer.options')); |
||
72 | |||
73 | $options = array_keys($options); |
||
74 | |||
75 | if(count($options) > 0) { |
||
76 | return '. Allowed options:[' . implode(', ', $options) . ']'; |
||
77 | } |
||
78 | |||
79 | return; |
||
80 | } |
||
81 | |||
82 | /** |
||
83 | * Returns initializer instance for current command. |
||
84 | * |
||
85 | * @return object |
||
86 | */ |
||
87 | abstract protected function getInitializerInstance(Container $container); |
||
88 | |||
89 | abstract protected function title(): string; |
||
90 | } |
||
91 |