@@ 200-215 (lines=16) @@ | ||
197 | */ |
|
198 | protected function interact(InputInterface $input, OutputInterface $output) |
|
199 | { |
|
200 | if (!$input->getArgument('username')) { |
|
201 | $question = New Question('Please choose a username:'); |
|
202 | $question->setValidator(function ($username) { |
|
203 | if (null === $username) { |
|
204 | throw new \InvalidArgumentException('Username can not be empty'); |
|
205 | } |
|
206 | ||
207 | return $username; |
|
208 | }); |
|
209 | $username = $this->getHelper('question')->ask( |
|
210 | $input, |
|
211 | $output, |
|
212 | $question |
|
213 | ); |
|
214 | $input->setArgument('username', $username); |
|
215 | } |
|
216 | ||
217 | if (!$input->getArgument('email')) { |
|
218 | $question = New Question('Please choose an email:'); |
|
@@ 217-232 (lines=16) @@ | ||
214 | $input->setArgument('username', $username); |
|
215 | } |
|
216 | ||
217 | if (!$input->getArgument('email')) { |
|
218 | $question = New Question('Please choose an email:'); |
|
219 | $question->setValidator(function ($email) { |
|
220 | if (null === $email) { |
|
221 | throw new \InvalidArgumentException('Email can not be empty'); |
|
222 | } |
|
223 | ||
224 | return $email; |
|
225 | }); |
|
226 | $email = $this->getHelper('question')->ask( |
|
227 | $input, |
|
228 | $output, |
|
229 | $question |
|
230 | ); |
|
231 | $input->setArgument('email', $email); |
|
232 | } |
|
233 | ||
234 | if (!$input->getArgument('password')) { |
|
235 |