1 | <?php |
||
17 | class Command extends SymfonyCommand |
||
18 | { |
||
19 | /** @var InputInterface */ |
||
20 | private $input; |
||
21 | /** @var OutputInterface */ |
||
22 | private $output; |
||
23 | /** @var string|null */ |
||
24 | public $dbConnection = null; |
||
25 | |||
26 | /** |
||
27 | * Set database connection name to use not with only default connection |
||
28 | * @param string|null $name |
||
29 | */ |
||
30 | public function setDbConnection($name = null) |
||
34 | |||
35 | /** |
||
36 | * Ask string param from stdin php input |
||
37 | * @param string $question |
||
38 | * @param string|null $default |
||
39 | * @return string |
||
40 | */ |
||
41 | public function ask($question, $default = null) |
||
47 | |||
48 | /** |
||
49 | * Ask confirmation for question (yes/no) |
||
50 | * @param string $question |
||
51 | * @param bool $default |
||
52 | * @return string |
||
53 | */ |
||
54 | public function confirm($question, $default = false) |
||
60 | |||
61 | /** |
||
62 | * Catch input & output instances inside class |
||
63 | * @param InputInterface $input |
||
64 | * @param OutputInterface $output |
||
65 | * @return int |
||
66 | */ |
||
67 | public function run(InputInterface $input, OutputInterface $output) |
||
73 | |||
74 | /** |
||
75 | * Get input option value or ask it if empty |
||
76 | * @param string $option |
||
77 | * @param string $question |
||
78 | * @param string|null $default |
||
79 | * @return string |
||
80 | */ |
||
81 | public function optionOrAsk($option, $question, $default = null) |
||
90 | |||
91 | /** |
||
92 | * Get input option value |
||
93 | * @param string $name |
||
94 | * @return string|null |
||
95 | */ |
||
96 | public function option($name) { |
||
99 | } |