From c351a309f1a02098f9a7ee24a8a402e9ce06fead Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 7 Apr 2021 08:11:23 -0500 Subject: [PATCH] formatting --- src/Illuminate/Queue/Console/RetryCommand.php | 31 +++++++++++++------ 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/src/Illuminate/Queue/Console/RetryCommand.php b/src/Illuminate/Queue/Console/RetryCommand.php index f32caf49fd85..212883fecdcb 100644 --- a/src/Illuminate/Queue/Console/RetryCommand.php +++ b/src/Illuminate/Queue/Console/RetryCommand.php @@ -64,16 +64,7 @@ protected function getJobIds() } if ($queue = $this->option('queue')) { - $ids = collect($this->laravel['queue.failer']->all()) - ->where('queue', $queue) - ->pluck('id') - ->toArray(); - - if (count($ids) === 0) { - $this->error("Unable to find failed jobs for queue [{$queue}]."); - } - - return $ids; + return $this->getJobIdsByQueue($queue); } if ($ranges = (array) $this->option('range')) { @@ -83,6 +74,26 @@ protected function getJobIds() return array_values(array_filter(array_unique($ids))); } + /** + * Get the job IDs by queue, if applicable. + * + * @param string $queue + * @return array + */ + protected function getJobIdsByQueue($queue) + { + $ids = collect($this->laravel['queue.failer']->all()) + ->where('queue', $queue) + ->pluck('id') + ->toArray(); + + if (count($ids) === 0) { + $this->error("Unable to find failed jobs for queue [{$queue}]."); + } + + return $ids; + } + /** * Get the job IDs ranges, if applicable. *