From 760aa9d402aa300349b18ba785fa7ccc4b5fccf5 Mon Sep 17 00:00:00 2001 From: Etienne Baroux Date: Tue, 3 Jun 2014 10:42:50 +0200 Subject: [ticket/12602] Changes to respect coding style and to factorize code. PHPBB3-12602 --- phpBB/phpbb/console/command/cron/cron_list.php | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'phpBB/phpbb/console/command/cron') diff --git a/phpBB/phpbb/console/command/cron/cron_list.php b/phpBB/phpbb/console/command/cron/cron_list.php index beedc3c932..f95cb6fb03 100644 --- a/phpBB/phpbb/console/command/cron/cron_list.php +++ b/phpBB/phpbb/console/command/cron/cron_list.php @@ -61,20 +61,26 @@ class cron_list extends \phpbb\console\command\command if (!empty($ready_tasks)) { $output->writeln('' . $this->user->lang('TASKS_READY') . ''); - foreach ($ready_tasks as $task) - { - $output->writeln($task->get_name()); - } + $this->print_tasks_names($ready_tasks, $output); + } + + if (!empty($ready_tasks) && !empty($not_ready_tasks)) + { $output->writeln(''); } if (!empty($not_ready_tasks)) { $output->writeln('' . $this->user->lang('TASKS_NOT_READY') . ''); - foreach ($not_ready_tasks as $task) - { - $output->writeln($task->get_name()); - } + $this->print_tasks_names($not_ready_tasks, $output); + } + } + + public function print_tasks_names ($tasks, $output) + { + foreach ($tasks as $task) + { + $output->writeln($task->get_name()); } } } -- cgit v1.2.1