diff options
author | Etienne Baroux <barouxe@phelma.grenoble-inp.fr> | 2014-06-03 10:42:50 +0200 |
---|---|---|
committer | Etienne Baroux <barouxe@phelma.grenoble-inp.fr> | 2014-06-03 10:42:50 +0200 |
commit | 760aa9d402aa300349b18ba785fa7ccc4b5fccf5 (patch) | |
tree | debbb9f251afdae0d70d2e504b7cf5bfb4ad974f /phpBB/phpbb/console/command/cron | |
parent | 71fb956498ec882573205a0a074350372f528020 (diff) | |
download | forums-760aa9d402aa300349b18ba785fa7ccc4b5fccf5.tar forums-760aa9d402aa300349b18ba785fa7ccc4b5fccf5.tar.gz forums-760aa9d402aa300349b18ba785fa7ccc4b5fccf5.tar.bz2 forums-760aa9d402aa300349b18ba785fa7ccc4b5fccf5.tar.xz forums-760aa9d402aa300349b18ba785fa7ccc4b5fccf5.zip |
[ticket/12602] Changes to respect coding style and to factorize code.
PHPBB3-12602
Diffstat (limited to 'phpBB/phpbb/console/command/cron')
-rw-r--r-- | phpBB/phpbb/console/command/cron/cron_list.php | 22 |
1 files changed, 14 insertions, 8 deletions
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('<info>' . $this->user->lang('TASKS_READY') . '</info>'); - 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('<info>' . $this->user->lang('TASKS_NOT_READY') . '</info>'); - 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()); } } } |