protected function interact(InputInterface $input, OutputInterface $output)
{
if (!$input->getArgument('username')) {
$username = $this->getHelper('dialog')->askAndValidate($output, 'Please give the username:', function ($username) {
if (empty($username)) {
throw new \Exception('Username can not be empty');
}
return $username;
});
$input->setArgument('username', $username);
}
if (!$input->getArgument('password')) {
$password = $this->getHelper('dialog')->askAndValidate($output, 'Please enter the new password:', function ($password) {
if (empty($password)) {
throw new \Exception('Password can not be empty');
}
return $password;
});
$input->setArgument('password', $password);
}
}