From e1451cbc647324a8ab1ab7e507c88eb293ee4e3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Guilbot?= Date: Tue, 29 Mar 2016 16:25:24 -0400 Subject: [PATCH 1/2] Replace deprecated Dialog helper in :purge command --- Command/PurgeConsumerCommand.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Command/PurgeConsumerCommand.php b/Command/PurgeConsumerCommand.php index 972c4093..c90356eb 100644 --- a/Command/PurgeConsumerCommand.php +++ b/Command/PurgeConsumerCommand.php @@ -6,6 +6,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ConfirmationQuestion; /** * Command to purge a queue @@ -32,8 +33,15 @@ protected function execute(InputInterface $input, OutputInterface $output) $noConfirmation = (bool) $input->getOption('no-confirmation'); if (!$noConfirmation && $input->isInteractive()) { - $confirmation = $this->getHelper('dialog')->askConfirmation($output, sprintf('Are you sure you wish to purge "%s" queue? (y/n)', $input->getArgument('name')), false); - if (!$confirmation) { + $question = new ConfirmationQuestion( + sprintf( + 'Are you sure you wish to purge "%s" queue? (y/n)', + $input->getArgument('name') + ), + false + ); + + if (!$this->getHelper('question')->ask($input, $output, $question)) { $output->writeln('Purging cancelled!'); return 1; From 70d2cfc76e7dff6504dbad6fd8089414982b8830 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Guilbot?= Date: Tue, 29 Mar 2016 16:29:01 -0400 Subject: [PATCH 2/2] Replace deprecated Dialog helper in :delete command --- Command/DeleteCommand.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Command/DeleteCommand.php b/Command/DeleteCommand.php index 8b9d1124..fa7428d0 100644 --- a/Command/DeleteCommand.php +++ b/Command/DeleteCommand.php @@ -6,6 +6,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ConfirmationQuestion; /** * Command to delete a queue @@ -32,8 +33,15 @@ protected function execute(InputInterface $input, OutputInterface $output) $noConfirmation = (bool) $input->getOption('no-confirmation'); if (!$noConfirmation && $input->isInteractive()) { - $confirmation = $this->getHelper('dialog')->askConfirmation($output, sprintf('Are you sure you wish to delete "%s" consumer\'s queue?(y/n)', $input->getArgument('name')), false); - if (!$confirmation) { + $question = new ConfirmationQuestion( + sprintf( + 'Are you sure you wish to delete "%s" consumer\'s queue? (y/n)', + $input->getArgument('name') + ), + false + ); + + if (!$this->getHelper('question')->ask($input, $output, $question)) { $output->writeln('Deletion cancelled!'); return 1;