diff options
Diffstat (limited to 'core/Command')
-rw-r--r-- | core/Command/Background/ListCommand.php | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/core/Command/Background/ListCommand.php b/core/Command/Background/ListCommand.php index bdd45f3a25f..30440b226de 100644 --- a/core/Command/Background/ListCommand.php +++ b/core/Command/Background/ListCommand.php @@ -72,15 +72,16 @@ class ListCommand extends Base { return 0; } - protected function formatJobs(array $jobs): array { - return array_map( - fn ($job) => [ + protected function formatJobs(iterable $jobs): array { + $jobsInfo = []; + foreach ($jobs as $job) { + $jobsInfo[] = [ 'id' => $job->getId(), 'class' => get_class($job), 'last_run' => date(DATE_ATOM, $job->getLastRun()), 'argument' => json_encode($job->getArgument()), - ], - $jobs - ); + ]; + } + return $jobsInfo; } } |