refactoring

This commit is contained in:
Simon Vieille 2015-02-10 16:22:33 +01:00
parent 2d8f3b4e79
commit 417093ae9b

View file

@ -25,13 +25,13 @@ class AuthLoginCommand extends Command
$client = new Client(); $client = new Client();
if ($configLoader->configExists()) { if ($configLoader->configExists()) {
$continue = $dialog->ask( $continue = $dialog->askConfirmation(
$output, $output,
'The configuration file already exists. Do you want to continue? (y/n, default: y) ', '<info>The configuration file already exists</info>. Do you want to continue? [yes] ',
'y' true
); );
if (!in_array($continue, ['y', 'yes'])) { if (!$continue) {
$output->writeln('Aborded.'); $output->writeln('Aborded.');
return; return;
@ -39,7 +39,7 @@ class AuthLoginCommand extends Command
} }
$username = $dialog->ask($output, 'Username: ', null); $username = $dialog->ask($output, 'Username: ', null);
$password = $dialog->ask($output, 'Password: ', null); $password = $dialog->askHiddenResponse($output, 'Password (hidden): ', null);
try { try {
$response = $client->getAuthorization($username, $password); $response = $client->getAuthorization($username, $password);