Skip to content

Commit

Permalink
[ticket/14895] Fix issues in CLI classes
Browse files Browse the repository at this point in the history
PHPBB3-14895
  • Loading branch information
iMattPro committed Dec 8, 2016
1 parent b17fa7d commit cbf6d71
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 44 deletions.
10 changes: 1 addition & 9 deletions phpBB/config/default/container/services_console.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }

Expand Down
4 changes: 2 additions & 2 deletions phpBB/phpbb/console/command/cache/purge.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -72,7 +72,7 @@ protected function configure()
* @param InputInterface $input An InputInterface instance
* @param OutputInterface $output An OutputInterface instance
*
* @return null
* @return void
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
Expand Down
2 changes: 1 addition & 1 deletion phpBB/phpbb/console/command/config/command.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion phpBB/phpbb/console/command/config/delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ protected function configure()
* @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)
Expand Down
2 changes: 1 addition & 1 deletion phpBB/phpbb/console/command/config/get.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ protected function configure()
* @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)
Expand Down
2 changes: 1 addition & 1 deletion phpBB/phpbb/console/command/config/increment.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected function configure()
* @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)
Expand Down
2 changes: 1 addition & 1 deletion phpBB/phpbb/console/command/config/set.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected function configure()
* @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)
Expand Down
2 changes: 1 addition & 1 deletion phpBB/phpbb/console/command/cron/cron_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ protected function configure()
* @param InputInterface $input An InputInterface instance
* @param OutputInterface $output An OutputInterface instance
*
* @return null
* @return void
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
Expand Down
6 changes: 3 additions & 3 deletions phpBB/phpbb/console/command/db/migrate.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
;
}

Expand Down
2 changes: 1 addition & 1 deletion phpBB/phpbb/console/command/db/migration_command.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
24 changes: 3 additions & 21 deletions phpBB/phpbb/console/command/db/revert.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,35 +18,17 @@
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')
)
;
}
Expand Down
2 changes: 1 addition & 1 deletion phpBB/phpbb/console/command/dev/migration_tips.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit cbf6d71

Please sign in to comment.