Skip to content

Commit 17a0f10

Browse files
improve messages
1 parent 5e4f863 commit 17a0f10

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/Commands/LaravelQueueCancelBatchCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function handle(): int
2727
if ($this->argument('batchUuids')) {
2828
$this->batches = collect($this->argument('batchUuids'));
2929
} else {
30-
$batches = collect($batchRepository->get(100, null))->reject(fn (Batch $batch) => $batch->pendingJobs < 1 || $batch->finished() || $batch->canceled());
30+
$allBatches = collect($batchRepository->get(100, null))->reject(fn (Batch $batch) => $batch->pendingJobs < 1 || $batch->finished() || $batch->canceled());
3131

3232
if ($allBatches->isEmpty()) {
3333
$this->info('There are no active batches.');
@@ -37,8 +37,8 @@ public function handle(): int
3737

3838
/** @var array<int, string> */
3939
$batchIds = multiselect(
40-
label: 'Select one or more batches to cancel',
41-
options: $batches->mapWithKeys(fn (Batch $batch) => [$batch->id => sprintf(
40+
label: 'Select one or more batches to cancel:',
41+
options: $allBatches->mapWithKeys(fn (Batch $batch) => [$batch->id => sprintf(
4242
'%s (%d/%d completed jobs; started %s)',
4343
$batch->name,
4444
$batch->pendingJobs,
@@ -51,7 +51,7 @@ public function handle(): int
5151
}
5252

5353
if ($this->batches->isEmpty()) {
54-
$this->info('No batches to cancel');
54+
$this->info('There are no active batches.');
5555

5656
return self::INVALID;
5757
}

tests/LaravelQueueCancelBatchCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101

102102
artisan(LaravelQueueCancelBatchCommand::class)
103103
->expectsQuestion(
104-
question: 'Select one or more batches to cancel',
104+
question: 'Select one or more batches to cancel:',
105105
answer: [$testBatch2->id, $testBatch3->id],
106106
)
107107
->assertSuccessful();

0 commit comments

Comments
 (0)