Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions Command/DeleteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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('<question>Are you sure you wish to delete "%s" consumer\'s queue?(y/n)</question>', $input->getArgument('name')), false);
if (!$confirmation) {
$question = new ConfirmationQuestion(
sprintf(
'<question>Are you sure you wish to delete "%s" consumer\'s queue? (y/n)</question>',
$input->getArgument('name')
),
false
);

if (!$this->getHelper('question')->ask($input, $output, $question)) {
$output->writeln('<error>Deletion cancelled!</error>');

return 1;
Expand Down
12 changes: 10 additions & 2 deletions Command/PurgeConsumerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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('<question>Are you sure you wish to purge "%s" queue? (y/n)</question>', $input->getArgument('name')), false);
if (!$confirmation) {
$question = new ConfirmationQuestion(
sprintf(
'<question>Are you sure you wish to purge "%s" queue? (y/n)</question>',
$input->getArgument('name')
),
false
);

if (!$this->getHelper('question')->ask($input, $output, $question)) {
$output->writeln('<error>Purging cancelled!</error>');

return 1;
Expand Down