From 6de699d318019324fd69a4468b2079b5d0d10ee0 Mon Sep 17 00:00:00 2001 From: Ruben Calvo Date: Sun, 11 Dec 2022 16:54:22 +0100 Subject: [PATCH] [ticket/12683] Small code style improvements PHPBB3-12683 --- phpBB/phpbb/console/command/reparser/list_all.php | 6 ++---- phpBB/phpbb/console/command/searchindex/create.php | 6 ++---- phpBB/phpbb/console/command/searchindex/delete.php | 6 ++---- phpBB/phpbb/console/command/searchindex/list_all.php | 8 +++----- phpBB/phpbb/di/exception/di_exception.php | 1 - .../exception/multiple_service_definitions_exception.php | 1 - phpBB/phpbb/di/exception/service_not_found_exception.php | 1 - phpBB/phpbb/search/backend/fulltext_native.php | 4 +++- phpBB/phpbb/search/state_helper.php | 4 ++-- 9 files changed, 14 insertions(+), 23 deletions(-) diff --git a/phpBB/phpbb/console/command/reparser/list_all.php b/phpBB/phpbb/console/command/reparser/list_all.php index ae90c1a68f..83c301e00f 100644 --- a/phpBB/phpbb/console/command/reparser/list_all.php +++ b/phpBB/phpbb/console/command/reparser/list_all.php @@ -49,10 +49,8 @@ class list_all extends \phpbb\console\command\command */ protected function configure() { - $this - ->setName('reparser:list') - ->setDescription($this->user->lang('CLI_DESCRIPTION_REPARSER_LIST')) - ; + $this->setName('reparser:list') + ->setDescription($this->user->lang('CLI_DESCRIPTION_REPARSER_LIST')); } /** diff --git a/phpBB/phpbb/console/command/searchindex/create.php b/phpBB/phpbb/console/command/searchindex/create.php index 9a1d54444e..2b368a475d 100644 --- a/phpBB/phpbb/console/command/searchindex/create.php +++ b/phpBB/phpbb/console/command/searchindex/create.php @@ -74,15 +74,13 @@ class create extends command */ protected function configure() { - $this - ->setName('searchindex:create') + $this->setName('searchindex:create') ->setDescription($this->language->lang('CLI_DESCRIPTION_SEARCHINDEX_CREATE')) ->addArgument( 'search-backend', InputArgument::REQUIRED, $this->language->lang('CLI_SEARCHINDEX_SEARCH_BACKEND_NAME') - ) - ; + ); } /** diff --git a/phpBB/phpbb/console/command/searchindex/delete.php b/phpBB/phpbb/console/command/searchindex/delete.php index 02c94cf082..b17622d68c 100644 --- a/phpBB/phpbb/console/command/searchindex/delete.php +++ b/phpBB/phpbb/console/command/searchindex/delete.php @@ -74,15 +74,13 @@ class delete extends command */ protected function configure() { - $this - ->setName('searchindex:delete') + $this->setName('searchindex:delete') ->setDescription($this->language->lang('CLI_DESCRIPTION_SEARCHINDEX_DELETE')) ->addArgument( 'search-backend', InputArgument::REQUIRED, $this->language->lang('CLI_SEARCHINDEX_SEARCH_BACKEND_NAME') - ) - ; + ); } /** diff --git a/phpBB/phpbb/console/command/searchindex/list_all.php b/phpBB/phpbb/console/command/searchindex/list_all.php index d23f46ea20..e88949fd2a 100644 --- a/phpBB/phpbb/console/command/searchindex/list_all.php +++ b/phpBB/phpbb/console/command/searchindex/list_all.php @@ -58,10 +58,8 @@ class list_all extends command */ protected function configure() { - $this - ->setName('searchindex:list') - ->setDescription($this->language->lang('CLI_DESCRIPTION_SEARCHINDEX_LIST')) - ; + $this->setName('searchindex:list') + ->setDescription($this->language->lang('CLI_DESCRIPTION_SEARCHINDEX_LIST')); } /** @@ -74,7 +72,7 @@ class list_all extends command * * @return int 0 if all is well, 1 if any errors occurred */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $io = new SymfonyStyle($input, $output); diff --git a/phpBB/phpbb/di/exception/di_exception.php b/phpBB/phpbb/di/exception/di_exception.php index 957e4f1b81..b4f3984b39 100644 --- a/phpBB/phpbb/di/exception/di_exception.php +++ b/phpBB/phpbb/di/exception/di_exception.php @@ -17,5 +17,4 @@ use phpbb\exception\runtime_exception; class di_exception extends runtime_exception { - } diff --git a/phpBB/phpbb/di/exception/multiple_service_definitions_exception.php b/phpBB/phpbb/di/exception/multiple_service_definitions_exception.php index 1c89b7a229..e29d47d26c 100644 --- a/phpBB/phpbb/di/exception/multiple_service_definitions_exception.php +++ b/phpBB/phpbb/di/exception/multiple_service_definitions_exception.php @@ -15,5 +15,4 @@ namespace phpbb\di\exception; class multiple_service_definitions_exception extends di_exception { - } diff --git a/phpBB/phpbb/di/exception/service_not_found_exception.php b/phpBB/phpbb/di/exception/service_not_found_exception.php index 06cb909d9c..79c69c85f6 100644 --- a/phpBB/phpbb/di/exception/service_not_found_exception.php +++ b/phpBB/phpbb/di/exception/service_not_found_exception.php @@ -15,5 +15,4 @@ namespace phpbb\di\exception; class service_not_found_exception extends di_exception { - } diff --git a/phpBB/phpbb/search/backend/fulltext_native.php b/phpBB/phpbb/search/backend/fulltext_native.php index 3d76638d67..aefc73b8cd 100644 --- a/phpBB/phpbb/search/backend/fulltext_native.php +++ b/phpBB/phpbb/search/backend/fulltext_native.php @@ -116,7 +116,9 @@ class fulltext_native extends base implements search_backend_interface * @param string $phpbb_root_path phpBB root path * @param string $phpEx PHP file extension */ - public function __construct(config $config, driver_interface $db, dispatcher_interface $phpbb_dispatcher, language $language, user $user, string $search_results_table, string $search_wordlist_table, string $search_wordmatch_table, string $phpbb_root_path, string $phpEx) + public function __construct(config $config, driver_interface $db, dispatcher_interface $phpbb_dispatcher, + language $language, user $user, string $search_results_table, string $search_wordlist_table, + string $search_wordmatch_table, string $phpbb_root_path, string $phpEx) { global $cache; diff --git a/phpBB/phpbb/search/state_helper.php b/phpBB/phpbb/search/state_helper.php index 809ac38fe7..b024c3dfe4 100644 --- a/phpBB/phpbb/search/state_helper.php +++ b/phpBB/phpbb/search/state_helper.php @@ -146,7 +146,7 @@ class state_helper */ public function clear_state(): void { - $this->save_state([]); + $this->save_state(); } /** @@ -176,6 +176,6 @@ class state_helper { ksort($state); - $this->config->set('search_indexing_state', implode(',', $state), true); + $this->config->set('search_indexing_state', implode(',', $state)); } }