2727use Symfony \Component \Console \Input \InputInterface ;
2828use Symfony \Component \Console \Input \InputOption ;
2929use Symfony \Component \Console \Output \OutputInterface ;
30+ use Symfony \Component \Console \Question \ConfirmationQuestion ;
3031use Symfony \Component \DependencyInjection \ContainerAwareInterface ;
3132use Symfony \Component \DependencyInjection \ContainerInterface ;
3233
@@ -80,22 +81,18 @@ protected function execute(InputInterface $input, OutputInterface $output)
8081 {
8182 $ this ->output = $ output ;
8283 $ registry = $ this ->container ->get ('uecode_qpush ' );
83- $ dialog = $ this ->getHelperSet ()->get ('dialog ' );
84-
84+ $ questionHelper = $ this ->getHelperSet ()->get ('question ' );
8585 $ name = $ input ->getArgument ('name ' );
8686
8787 if (null !== $ name ) {
8888 if (!$ input ->getOption ('force ' )) {
89- $ response = $ dialog ->askConfirmation (
90- $ output ,
91- sprintf (
92- '<comment>This will remove the %s queue, even if it has messages! Are you sure? </comment> ' ,
93- $ name
94- ),
95- false
96- );
97-
98- if (!$ response ) {
89+ $ question = new ConfirmationQuestion (sprintf (
90+ '<comment>This will remove the %s queue, even if it has messages! Are you sure? </comment> ' ,
91+ $ name
92+ ));
93+ $ confirmation = $ questionHelper ->ask ($ input , $ output , $ question );
94+
95+ if (!$ confirmation ) {
9996 return 0 ;
10097 }
10198 }
@@ -104,13 +101,10 @@ protected function execute(InputInterface $input, OutputInterface $output)
104101 }
105102
106103 if (!$ input ->getOption ('force ' )) {
107- $ response = $ dialog ->askConfirmation (
108- $ output ,
109- '<comment>This will remove ALL queues, even if they have messages. Are you sure? </comment> ' ,
110- false
111- );
104+ $ question = new ConfirmationQuestion ('<comment>This will remove ALL queues, even if they have messages. Are you sure? </comment> ' );
105+ $ confirmation = $ questionHelper ->ask ($ input , $ output , $ question );
112106
113- if (!$ response ) {
107+ if (!$ confirmation ) {
114108 return 0 ;
115109 }
116110 }
0 commit comments