Skip to content

Commit 8fac66d

Browse files
committed
Apply code review
1 parent ebb048c commit 8fac66d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Command/PurgeConsumerCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
use Symfony\Component\Console\Input\InputOption;
88
use Symfony\Component\Console\Output\OutputInterface;
99

10+
/**
11+
* Command to purge a queue
12+
*/
1013
class PurgeConsumerCommand extends ConsumerCommand
1114
{
12-
/**
13-
* Command to purge a queue
14-
*/
1515
protected function configure()
1616
{
1717
$this->addArgument('name', InputArgument::REQUIRED, 'Consumer Name')
@@ -30,7 +30,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
3030
{
3131
$noConfirmation = (bool) $input->getOption('no-confirmation');
3232

33-
if (!$noConfirmation) {
33+
if (!$noConfirmation && $input->isInteractive()) {
3434
$confirmation = $this->getHelper('dialog')->askConfirmation($output, sprintf('<question>Are you sure you wish to purge "%s" queue? (y/n)</question>', $input->getArgument('name')), false);
3535
if (!$confirmation) {
3636
$output->writeln('<error>Purging cancelled!</error>');

0 commit comments

Comments
 (0)