diff options
author | LEZY Thomas <thomas.gif.91@gmail.com> | 2014-05-28 21:26:33 +0200 |
---|---|---|
committer | LEZY Thomas <thomas.gif.91@gmail.com> | 2014-05-28 21:26:33 +0200 |
commit | 54d60e3f7864cf0da4c6da9c824e29ba51d57a37 (patch) | |
tree | cc1c7bc7909cddc0f39ac11ae8f14f24b1498765 /phpBB/phpbb/console/command/cron | |
parent | 9f942776ad5a3b396045e6f97db6ef655c5d9fcc (diff) | |
download | forums-54d60e3f7864cf0da4c6da9c824e29ba51d57a37.tar forums-54d60e3f7864cf0da4c6da9c824e29ba51d57a37.tar.gz forums-54d60e3f7864cf0da4c6da9c824e29ba51d57a37.tar.bz2 forums-54d60e3f7864cf0da4c6da9c824e29ba51d57a37.tar.xz forums-54d60e3f7864cf0da4c6da9c824e29ba51d57a37.zip |
[ticket/12597] Fix coding style and typing mistakes
PHPBB3-12597
Diffstat (limited to 'phpBB/phpbb/console/command/cron')
-rw-r--r-- | phpBB/phpbb/console/command/cron/run.php | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/phpBB/phpbb/console/command/cron/run.php b/phpBB/phpbb/console/command/cron/run.php index 701f0f02fb..7387c260a9 100644 --- a/phpBB/phpbb/console/command/cron/run.php +++ b/phpBB/phpbb/console/command/cron/run.php @@ -55,7 +55,7 @@ class run extends \phpbb\console\command\command $this ->setName('cron:run') ->setDescription($this->user->lang('CLI_DESCR_CRON_RUN')) - ->addArgument('name', InputArgument::OPTIONAL, $this->user->lang('CLI_DESCR_CRON_ARG_RUN_1')); + ->addArgument('name', InputArgument::OPTIONAL, $this->user->lang('CLI_DESCR_CRON_ARG_RUN_1')) ; } @@ -69,11 +69,11 @@ class run extends \phpbb\console\command\command * Otherwise there is no output. * If an argument is given to the command, only the task whose name matches the * argument will be started. If none exists, an error message is - * printed and theexit status is set to -1. Verbose option does nothing in + * printed and the exit status is set to 2. Verbose option does nothing in * this case. * - * @param InputInterface $input The input stream, unused here - * @param OutputInterface $output The output stream, used for printig verbose-mode and error information. + * @param InputInterface $input The input stream used to get the argument + * @param OutputInterface $output The output stream, used for printing verbose-mode and error information. * * @return int 0 if all is ok, 1 if a lock error occured and -1 if no task matching the argument was found */ @@ -81,9 +81,11 @@ class run extends \phpbb\console\command\command { if ($this->lock_db->acquire()) { - if ($task_name = $input->getArgument('name')) + $task_name = $input->getArgument('name'); + if ($task_name) { - if ($task = $this->cron_manager->find_task($task_name)) + $task = $this->cron_manager->find_task($task_name); + if ($task) { $task->run(); return 0; @@ -91,7 +93,7 @@ class run extends \phpbb\console\command\command else { $output->writeln('<error>' . $this->user->lang('CRON_NO_TASK') . '</error>'); - return -1; + return 2; } } else |