Skip to content

Commit 4378c4d

Browse files
committed
more casting fixes in commands
1 parent 2b19739 commit 4378c4d

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/Commands/QueueFlush.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ public function run(array $params)
5656
$hours = $params['hours'] ?? CLI::getOption('hours');
5757
$queue = $params['queue'] ?? CLI::getOption('queue');
5858

59+
if ($hours !== null) {
60+
$hours = (int) $hours;
61+
}
62+
5963
service('queue')->flush($hours, $queue);
6064

6165
if ($hours === null) {

src/Commands/QueueForget.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function run(array $params)
5959
return EXIT_ERROR;
6060
}
6161

62-
if (service('queue')->forget($id)) {
62+
if (service('queue')->forget((int) $id)) {
6363
CLI::write(sprintf('Failed job with ID %s has been removed.', $id), 'green');
6464
} else {
6565
CLI::write(sprintf('Could not find the failed job with ID %s', $id), 'red');

src/Commands/QueueRetry.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,7 @@ public function run(array $params)
6868
return EXIT_ERROR;
6969
}
7070

71-
if ($id === 'all') {
72-
$id = null;
73-
}
71+
$id = $id === 'all' ? null : (int) $id;
7472

7573
$queue = $params['queue'] ?? CLI::getOption('queue');
7674

0 commit comments

Comments
 (0)