@@ -96,7 +96,7 @@ public function execute(Arguments $args, ConsoleIo $io)
9696 return self ::CODE_SUCCESS ;
9797 }
9898
99- if ($ args ->getOption ('all ' )) {
99+ if ($ args ->getOption ('all ' ) === true ) {
100100 $ this ->checkConfirmation (
101101 __ ('Are you sure you want to purge messages from all queues? ' ),
102102 $ args ,
@@ -134,7 +134,7 @@ public function execute(Arguments $args, ConsoleIo $io)
134134 );
135135
136136 try {
137- $ this ->enqueueClientService ->purgeQueue ($ queueConfig );
137+ $ this ->enqueueClientService ->purgeQueue (( string ) $ queueConfig );
138138 $ io ->success (__ ('Queue `{0}` purged successfully ' , $ queueConfig ));
139139
140140 return self ::CODE_SUCCESS ;
@@ -151,7 +151,7 @@ public function execute(Arguments $args, ConsoleIo $io)
151151 */
152152 private function validateQueueConfig (?string $ queueConfig ): bool
153153 {
154- if (empty ($ queueConfig )) {
154+ if (is_null ( $ queueConfig ) || ! strlen ($ queueConfig )) {
155155 return false ;
156156 }
157157
@@ -177,7 +177,7 @@ private function getConfiguredQueues(): array
177177 */
178178 private function checkConfirmation (string $ prompt , Arguments $ args , ConsoleIo $ io ): void
179179 {
180- if (! $ args ->getOption ('yes ' )) {
180+ if ($ args ->getOption ('yes ' ) === false ) {
181181 $ confirmation = $ io ->askChoice (
182182 $ prompt ,
183183 [
0 commit comments