1 | <?php |
||
9 | abstract class BaseCommand extends Command |
||
10 | { |
||
11 | /** |
||
12 | * @var InputInterface |
||
13 | */ |
||
14 | protected $input; |
||
15 | /** |
||
16 | * @var OutputInterface |
||
17 | */ |
||
18 | protected $output; |
||
19 | |||
20 | protected function execute(InputInterface $input, OutputInterface $output) |
||
27 | |||
28 | abstract public function fire(); |
||
29 | |||
30 | /** |
||
31 | * Write a string as information output. |
||
32 | * |
||
33 | * @param string $string |
||
34 | * @return void |
||
35 | */ |
||
36 | public function info($string) |
||
40 | |||
41 | /** |
||
42 | * Write a string as standard output. |
||
43 | * |
||
44 | * @param string $string |
||
45 | * @param string $style |
||
46 | * @return void |
||
47 | */ |
||
48 | public function line($string, $style = null) |
||
53 | |||
54 | /** |
||
55 | * Write a string as comment output. |
||
56 | * |
||
57 | * @param string $string |
||
58 | * @return void |
||
59 | */ |
||
60 | public function comment($string) |
||
64 | |||
65 | /** |
||
66 | * Write a string as question output. |
||
67 | * |
||
68 | * @param string $string |
||
69 | * @return void |
||
70 | */ |
||
71 | public function question($string) |
||
75 | |||
76 | /** |
||
77 | * Write a string as error output. |
||
78 | * |
||
79 | * @param string $string |
||
80 | * @return void |
||
81 | */ |
||
82 | public function error($string) |
||
86 | |||
87 | /** |
||
88 | * Get the value of a command argument. |
||
89 | * |
||
90 | * @param string $key |
||
91 | * @return string|array |
||
92 | */ |
||
93 | public function argument($key = null) |
||
100 | |||
101 | /** |
||
102 | * Get the value of a command option. |
||
103 | * |
||
104 | * @param string $key |
||
105 | * @return string|array |
||
106 | */ |
||
107 | public function option($key = null) |
||
114 | } |
||
115 |