Move to question helper
This commit is contained in:
parent
1ec5e8a1ab
commit
a9c6c351cb
|
@ -28,6 +28,7 @@ use OCP\IGroupManager;
|
||||||
use OCP\IUser;
|
use OCP\IUser;
|
||||||
use OCP\IUserManager;
|
use OCP\IUserManager;
|
||||||
use Symfony\Component\Console\Command\Command;
|
use Symfony\Component\Console\Command\Command;
|
||||||
|
use Symfony\Component\Console\Helper\QuestionHelper;
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
use Symfony\Component\Console\Input\InputOption;
|
use Symfony\Component\Console\Input\InputOption;
|
||||||
use Symfony\Component\Console\Output\OutputInterface;
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
|
@ -94,18 +95,16 @@ class Add extends Command {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
} elseif ($input->isInteractive()) {
|
} elseif ($input->isInteractive()) {
|
||||||
/** @var $dialog \Symfony\Component\Console\Helper\DialogHelper */
|
/** @var QuestionHelper $helper */
|
||||||
$dialog = $this->getHelperSet()->get('dialog');
|
$helper = $this->getHelper('question');
|
||||||
$password = $dialog->askHiddenResponse(
|
|
||||||
$output,
|
$question = new Question('Enter password: ');
|
||||||
'<question>Enter password: </question>',
|
$question->setHidden(true);
|
||||||
false
|
$password = $helper->ask($input, $output, $question);
|
||||||
);
|
|
||||||
$confirm = $dialog->askHiddenResponse(
|
$question = new Question('Confirm password: ');
|
||||||
$output,
|
$question->setHidden(true);
|
||||||
'<question>Confirm password: </question>',
|
$confirm = $helper->ask($input, $output,$question);
|
||||||
false
|
|
||||||
);
|
|
||||||
|
|
||||||
if ($password !== $confirm) {
|
if ($password !== $confirm) {
|
||||||
$output->writeln("<error>Passwords did not match!</error>");
|
$output->writeln("<error>Passwords did not match!</error>");
|
||||||
|
|
Loading…
Reference in New Issue