Skip to content

Commit d57f67d

Browse files
committed
fix psalm issues
1 parent c466f98 commit d57f67d

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/Command/PurgeQueueCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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
[

src/Mailer/TestQueueMailer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Cake\Mailer\Mailer;
1717
use Cake\Mailer\Message;
1818
use Cake\Queue\Mailer\QueueTrait;
19+
use function Cake\I18n\__;
1920

2021
/**
2122
* Test Queue Mailer

0 commit comments

Comments
 (0)