@@ -96,7 +96,7 @@ public function execute(Arguments $args, ConsoleIo $io)
96
96
return self ::CODE_SUCCESS ;
97
97
}
98
98
99
- if ($ args ->getOption ('all ' )) {
99
+ if ($ args ->getOption ('all ' ) === true ) {
100
100
$ this ->checkConfirmation (
101
101
__ ('Are you sure you want to purge messages from all queues? ' ),
102
102
$ args ,
@@ -134,7 +134,7 @@ public function execute(Arguments $args, ConsoleIo $io)
134
134
);
135
135
136
136
try {
137
- $ this ->enqueueClientService ->purgeQueue ($ queueConfig );
137
+ $ this ->enqueueClientService ->purgeQueue (( string ) $ queueConfig );
138
138
$ io ->success (__ ('Queue `{0}` purged successfully ' , $ queueConfig ));
139
139
140
140
return self ::CODE_SUCCESS ;
@@ -151,7 +151,7 @@ public function execute(Arguments $args, ConsoleIo $io)
151
151
*/
152
152
private function validateQueueConfig (?string $ queueConfig ): bool
153
153
{
154
- if (empty ($ queueConfig )) {
154
+ if (is_null ( $ queueConfig ) || ! strlen ($ queueConfig )) {
155
155
return false ;
156
156
}
157
157
@@ -177,7 +177,7 @@ private function getConfiguredQueues(): array
177
177
*/
178
178
private function checkConfirmation (string $ prompt , Arguments $ args , ConsoleIo $ io ): void
179
179
{
180
- if (! $ args ->getOption ('yes ' )) {
180
+ if ($ args ->getOption ('yes ' ) === false ) {
181
181
$ confirmation = $ io ->askChoice (
182
182
$ prompt ,
183
183
[
0 commit comments