1 | <?php |
||
11 | abstract class Command extends SymfonyCommand |
||
12 | { |
||
13 | /** |
||
14 | * Symfony console output. |
||
15 | * |
||
16 | * @var SymfonyOutput |
||
17 | */ |
||
18 | protected $output; |
||
19 | |||
20 | /** |
||
21 | * Symfony input implementation. |
||
22 | * |
||
23 | * @var InputInterface |
||
24 | */ |
||
25 | protected $input; |
||
26 | |||
27 | /** |
||
28 | * The command description. |
||
29 | * |
||
30 | * @var string |
||
31 | */ |
||
32 | protected $description; |
||
33 | |||
34 | /** |
||
35 | * Command signature. |
||
36 | * |
||
37 | * @var null|string |
||
38 | */ |
||
39 | protected $signature = null; |
||
40 | |||
41 | /** |
||
42 | * Configure the command if signature is set. |
||
43 | */ |
||
44 | protected function configure() |
||
54 | |||
55 | /** |
||
56 | * Execute the command. |
||
57 | * |
||
58 | * @param InputInterface $input |
||
59 | * @param OutputInterface $output |
||
60 | */ |
||
61 | protected function execute(InputInterface $input, OutputInterface $output) |
||
71 | |||
72 | /** |
||
73 | * Return the output implementation. |
||
74 | * |
||
75 | * @return SymfonyOutput |
||
76 | */ |
||
77 | protected function getOutput() |
||
81 | |||
82 | /** |
||
83 | * Get root symfony output implementation. |
||
84 | * |
||
85 | * @return OutputInterface |
||
86 | */ |
||
87 | protected function getOutputInterface() |
||
91 | |||
92 | /** |
||
93 | * Get the value of a command argument. |
||
94 | * |
||
95 | * @param string $key |
||
96 | * |
||
97 | * @return string|array |
||
98 | */ |
||
99 | protected function argument($key = null) |
||
107 | |||
108 | /** |
||
109 | * Determine if the given argument is present. |
||
110 | * |
||
111 | * @param string|int $name |
||
112 | * |
||
113 | * @return bool |
||
114 | */ |
||
115 | protected function hasArgument($name) |
||
119 | |||
120 | /** |
||
121 | * Get the value of a command option. |
||
122 | * |
||
123 | * @param string $key |
||
124 | * |
||
125 | * @return string|array |
||
126 | */ |
||
127 | protected function option($key = null) |
||
135 | |||
136 | /** |
||
137 | * Determine if the given option is present. |
||
138 | * |
||
139 | * @param string $name |
||
140 | * |
||
141 | * @return bool |
||
142 | */ |
||
143 | protected function hasOption($name) |
||
147 | |||
148 | /** |
||
149 | * Add input to the command. |
||
150 | * |
||
151 | * @param Input $input |
||
152 | */ |
||
153 | public function addInput(Input $input) |
||
163 | } |
||
164 |