aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Friedman <maf675@gmail.com>2016-12-08 14:25:09 -0800
committerMatt Friedman <maf675@gmail.com>2016-12-08 14:25:09 -0800
commitcbf6d71f6859fd6c036967ed19082f3e54efc328 (patch)
tree0db265f8f3679b7a2004f4100fc33f5106a733d9
parentb17fa7dfa588fc191f4ed268b88dcaec40294acb (diff)
downloadforums-cbf6d71f6859fd6c036967ed19082f3e54efc328.tar
forums-cbf6d71f6859fd6c036967ed19082f3e54efc328.tar.gz
forums-cbf6d71f6859fd6c036967ed19082f3e54efc328.tar.bz2
forums-cbf6d71f6859fd6c036967ed19082f3e54efc328.tar.xz
forums-cbf6d71f6859fd6c036967ed19082f3e54efc328.zip
[ticket/14895] Fix issues in CLI classes
PHPBB3-14895
-rw-r--r--phpBB/config/default/container/services_console.yml10
-rw-r--r--phpBB/phpbb/console/command/cache/purge.php4
-rw-r--r--phpBB/phpbb/console/command/config/command.php2
-rw-r--r--phpBB/phpbb/console/command/config/delete.php2
-rw-r--r--phpBB/phpbb/console/command/config/get.php2
-rw-r--r--phpBB/phpbb/console/command/config/increment.php2
-rw-r--r--phpBB/phpbb/console/command/config/set.php2
-rw-r--r--phpBB/phpbb/console/command/cron/cron_list.php2
-rw-r--r--phpBB/phpbb/console/command/db/migrate.php6
-rw-r--r--phpBB/phpbb/console/command/db/migration_command.php2
-rw-r--r--phpBB/phpbb/console/command/db/revert.php24
-rw-r--r--phpBB/phpbb/console/command/dev/migration_tips.php2
-rw-r--r--phpBB/phpbb/console/command/fixup/recalculate_email_hash.php2
13 files changed, 18 insertions, 44 deletions
diff --git a/phpBB/config/default/container/services_console.yml b/phpBB/config/default/container/services_console.yml
index 0c609a8051..e25ab4f03f 100644
--- a/phpBB/config/default/container/services_console.yml
+++ b/phpBB/config/default/container/services_console.yml
@@ -111,15 +111,7 @@ services:
console.command.db.revert:
class: phpbb\console\command\db\revert
- arguments:
- - '@user'
- - '@language'
- - '@migrator'
- - '@ext.manager'
- - '@config'
- - '@cache'
- - '@filesystem'
- - '%core.root_path%'
+ parent: console.command.db.migrate
tags:
- { name: console.command }
diff --git a/phpBB/phpbb/console/command/cache/purge.php b/phpBB/phpbb/console/command/cache/purge.php
index 1da97624f5..b7a51b2bb4 100644
--- a/phpBB/phpbb/console/command/cache/purge.php
+++ b/phpBB/phpbb/console/command/cache/purge.php
@@ -40,7 +40,7 @@ class purge extends \phpbb\console\command\command
* @param \phpbb\cache\driver\driver_interface $cache Cache instance
* @param \phpbb\db\driver\driver_interface $db Database connection
* @param \phpbb\auth\auth $auth Auth instance
- * @param \phpbb\log\log $log Logger instance
+ * @param \phpbb\log\log_interface $log Logger instance
* @param \phpbb\config\config $config Config instance
*/
public function __construct(\phpbb\user $user, \phpbb\cache\driver\driver_interface $cache, \phpbb\db\driver\driver_interface $db, \phpbb\auth\auth $auth, \phpbb\log\log_interface $log, \phpbb\config\config $config)
@@ -72,7 +72,7 @@ class purge extends \phpbb\console\command\command
* @param InputInterface $input An InputInterface instance
* @param OutputInterface $output An OutputInterface instance
*
- * @return null
+ * @return void
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
diff --git a/phpBB/phpbb/console/command/config/command.php b/phpBB/phpbb/console/command/config/command.php
index f0ad5d4d19..19f67d3b6c 100644
--- a/phpBB/phpbb/console/command/config/command.php
+++ b/phpBB/phpbb/console/command/config/command.php
@@ -17,7 +17,7 @@ abstract class command extends \phpbb\console\command\command
/** @var \phpbb\config\config */
protected $config;
- function __construct(\phpbb\user $user, \phpbb\config\config $config)
+ public function __construct(\phpbb\user $user, \phpbb\config\config $config)
{
$this->config = $config;
diff --git a/phpBB/phpbb/console/command/config/delete.php b/phpBB/phpbb/console/command/config/delete.php
index a1ccefe286..2da0801337 100644
--- a/phpBB/phpbb/console/command/config/delete.php
+++ b/phpBB/phpbb/console/command/config/delete.php
@@ -43,7 +43,7 @@ class delete extends command
* @param InputInterface $input An InputInterface instance
* @param OutputInterface $output An OutputInterface instance
*
- * @return null
+ * @return void
* @see \phpbb\config\config::delete()
*/
protected function execute(InputInterface $input, OutputInterface $output)
diff --git a/phpBB/phpbb/console/command/config/get.php b/phpBB/phpbb/console/command/config/get.php
index b2b824dd12..f065787110 100644
--- a/phpBB/phpbb/console/command/config/get.php
+++ b/phpBB/phpbb/console/command/config/get.php
@@ -50,7 +50,7 @@ class get extends command
* @param InputInterface $input An InputInterface instance
* @param OutputInterface $output An OutputInterface instance
*
- * @return null
+ * @return void
* @see \phpbb\config\config::offsetGet()
*/
protected function execute(InputInterface $input, OutputInterface $output)
diff --git a/phpBB/phpbb/console/command/config/increment.php b/phpBB/phpbb/console/command/config/increment.php
index 8b3acc1620..647380a0bf 100644
--- a/phpBB/phpbb/console/command/config/increment.php
+++ b/phpBB/phpbb/console/command/config/increment.php
@@ -55,7 +55,7 @@ class increment extends command
* @param InputInterface $input An InputInterface instance
* @param OutputInterface $output An OutputInterface instance
*
- * @return null
+ * @return void
* @see \phpbb\config\config::increment()
*/
protected function execute(InputInterface $input, OutputInterface $output)
diff --git a/phpBB/phpbb/console/command/config/set.php b/phpBB/phpbb/console/command/config/set.php
index 889fb630c6..e9f7f8f91e 100644
--- a/phpBB/phpbb/console/command/config/set.php
+++ b/phpBB/phpbb/console/command/config/set.php
@@ -55,7 +55,7 @@ class set extends command
* @param InputInterface $input An InputInterface instance
* @param OutputInterface $output An OutputInterface instance
*
- * @return null
+ * @return void
* @see \phpbb\config\config::set()
*/
protected function execute(InputInterface $input, OutputInterface $output)
diff --git a/phpBB/phpbb/console/command/cron/cron_list.php b/phpBB/phpbb/console/command/cron/cron_list.php
index 0618cee4db..8f9d63eda2 100644
--- a/phpBB/phpbb/console/command/cron/cron_list.php
+++ b/phpBB/phpbb/console/command/cron/cron_list.php
@@ -52,7 +52,7 @@ class cron_list extends \phpbb\console\command\command
* @param InputInterface $input An InputInterface instance
* @param OutputInterface $output An OutputInterface instance
*
- * @return null
+ * @return void
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
diff --git a/phpBB/phpbb/console/command/db/migrate.php b/phpBB/phpbb/console/command/db/migrate.php
index f2cc9142a6..4270e2d703 100644
--- a/phpBB/phpbb/console/command/db/migrate.php
+++ b/phpBB/phpbb/console/command/db/migrate.php
@@ -31,21 +31,21 @@ class migrate extends \phpbb\console\command\db\migration_command
/** @var \phpbb\language\language */
protected $language;
- function __construct(\phpbb\user $user, \phpbb\language\language $language, \phpbb\db\migrator $migrator, \phpbb\extension\manager $extension_manager, \phpbb\config\config $config, \phpbb\cache\service $cache, \phpbb\log\log $log, \phpbb\filesystem\filesystem_interface $filesystem, $phpbb_root_path)
+ public function __construct(\phpbb\user $user, \phpbb\language\language $language, \phpbb\db\migrator $migrator, \phpbb\extension\manager $extension_manager, \phpbb\config\config $config, \phpbb\cache\service $cache, \phpbb\log\log $log, \phpbb\filesystem\filesystem_interface $filesystem, $phpbb_root_path)
{
$this->language = $language;
$this->log = $log;
$this->filesystem = $filesystem;
$this->phpbb_root_path = $phpbb_root_path;
parent::__construct($user, $migrator, $extension_manager, $config, $cache);
- $this->user->add_lang(array('common', 'install', 'migrator'));
+ $this->language->add_lang(array('common', 'install', 'migrator'));
}
protected function configure()
{
$this
->setName('db:migrate')
- ->setDescription($this->user->lang('CLI_DESCRIPTION_DB_MIGRATE'))
+ ->setDescription($this->language->lang('CLI_DESCRIPTION_DB_MIGRATE'))
;
}
diff --git a/phpBB/phpbb/console/command/db/migration_command.php b/phpBB/phpbb/console/command/db/migration_command.php
index b951560588..851f404fab 100644
--- a/phpBB/phpbb/console/command/db/migration_command.php
+++ b/phpBB/phpbb/console/command/db/migration_command.php
@@ -26,7 +26,7 @@ abstract class migration_command extends \phpbb\console\command\command
/** @var \phpbb\cache\service */
protected $cache;
- function __construct(\phpbb\user $user, \phpbb\db\migrator $migrator, \phpbb\extension\manager $extension_manager, \phpbb\config\config $config, \phpbb\cache\service $cache)
+ public function __construct(\phpbb\user $user, \phpbb\db\migrator $migrator, \phpbb\extension\manager $extension_manager, \phpbb\config\config $config, \phpbb\cache\service $cache)
{
$this->migrator = $migrator;
$this->extension_manager = $extension_manager;
diff --git a/phpBB/phpbb/console/command/db/revert.php b/phpBB/phpbb/console/command/db/revert.php
index 7977afc319..3c79d8c554 100644
--- a/phpBB/phpbb/console/command/db/revert.php
+++ b/phpBB/phpbb/console/command/db/revert.php
@@ -18,35 +18,17 @@ use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
-class revert extends \phpbb\console\command\db\migration_command
+class revert extends \phpbb\console\command\db\migrate
{
- /** @var string phpBB root path */
- protected $phpbb_root_path;
-
- /** @var \phpbb\filesystem\filesystem_interface */
- protected $filesystem;
-
- /** @var \phpbb\language\language */
- protected $language;
-
- function __construct(\phpbb\user $user, \phpbb\language\language $language, \phpbb\db\migrator $migrator, \phpbb\extension\manager $extension_manager, \phpbb\config\config $config, \phpbb\cache\service $cache, \phpbb\filesystem\filesystem_interface $filesystem, $phpbb_root_path)
- {
- $this->filesystem = $filesystem;
- $this->language = $language;
- $this->phpbb_root_path = $phpbb_root_path;
- parent::__construct($user, $migrator, $extension_manager, $config, $cache);
- $this->user->add_lang(array('common', 'migrator'));
- }
-
protected function configure()
{
$this
->setName('db:revert')
- ->setDescription($this->user->lang('CLI_DESCRIPTION_DB_REVERT'))
+ ->setDescription($this->language->lang('CLI_DESCRIPTION_DB_REVERT'))
->addArgument(
'name',
InputArgument::REQUIRED,
- $this->user->lang('CLI_MIGRATION_NAME')
+ $this->language->lang('CLI_MIGRATION_NAME')
)
;
}
diff --git a/phpBB/phpbb/console/command/dev/migration_tips.php b/phpBB/phpbb/console/command/dev/migration_tips.php
index f9047bdac8..2ca0ddde2f 100644
--- a/phpBB/phpbb/console/command/dev/migration_tips.php
+++ b/phpBB/phpbb/console/command/dev/migration_tips.php
@@ -20,7 +20,7 @@ class migration_tips extends \phpbb\console\command\command
/** @var \phpbb\extension\manager */
protected $extension_manager;
- function __construct(\phpbb\user $user, \phpbb\extension\manager $extension_manager)
+ public function __construct(\phpbb\user $user, \phpbb\extension\manager $extension_manager)
{
$this->extension_manager = $extension_manager;
parent::__construct($user);
diff --git a/phpBB/phpbb/console/command/fixup/recalculate_email_hash.php b/phpBB/phpbb/console/command/fixup/recalculate_email_hash.php
index 043f181e72..6f7096296d 100644
--- a/phpBB/phpbb/console/command/fixup/recalculate_email_hash.php
+++ b/phpBB/phpbb/console/command/fixup/recalculate_email_hash.php
@@ -21,7 +21,7 @@ class recalculate_email_hash extends \phpbb\console\command\command
/** @var \phpbb\db\driver\driver_interface */
protected $db;
- function __construct(\phpbb\user $user, \phpbb\db\driver\driver_interface $db)
+ public function __construct(\phpbb\user $user, \phpbb\db\driver\driver_interface $db)
{
$this->db = $db;