diff --git a/db_central_columns.php b/db_central_columns.php index 0f92d3ab0c..9c175e9fb0 100644 --- a/db_central_columns.php +++ b/db_central_columns.php @@ -30,7 +30,7 @@ if (isset($_POST['edit_save']) || isset($_POST['add_new_column'])) { $col_default = ""; } $col_extra = isset($_POST['col_extra']) ? $_POST['col_extra'] : ''; - $col_isNull = isset($_POST['col_isNull'])?1:0; + $col_isNull = isset($_POST['col_isNull']) ? 1 : 0; $col_length = $_POST['col_length']; $col_attribute = $_POST['col_attribute']; $col_type = $_POST['col_type']; diff --git a/libraries/classes/CentralColumns.php b/libraries/classes/CentralColumns.php index 88a5a832a2..22a25ee4f6 100644 --- a/libraries/classes/CentralColumns.php +++ b/libraries/classes/CentralColumns.php @@ -82,7 +82,7 @@ class CentralColumns /** * Defines the central_columns parameters for the current user * - * @return array the central_columns parameters for the current user + * @return array|bool the central_columns parameters for the current user * @access public */ public function getParams() @@ -119,7 +119,7 @@ class CentralColumns * @return array list of $num columns present in central columns list * starting at offset $from for the given database */ - public function getColumnsList($db, $from = 0, $num = 25) + public function getColumnsList(string $db, int $from = 0, int $num = 25): array { $cfgCentralColumns = $this->getParams(); if (empty($cfgCentralColumns)) { @@ -151,7 +151,7 @@ class CentralColumns * * @return int number of columns in central list of columns for $db */ - public function getCount($db) + public function getCount(string $db): int { $cfgCentralColumns = $this->getParams(); if (empty($cfgCentralColumns)) { @@ -184,10 +184,10 @@ class CentralColumns * @return array list of columns in central columns among given set of columns */ private function findExistingColNames( - $db, - $cols, - $allFields = false - ) { + string $db, + string $cols, + bool $allFields = false + ): array { $cfgCentralColumns = $this->getParams(); if (empty($cfgCentralColumns)) { return array(); @@ -220,7 +220,7 @@ class CentralColumns * * @return Message */ - private function configErrorMessage() + private function configErrorMessage(): Message { return Message::error( __( @@ -243,11 +243,11 @@ class CentralColumns * with definition into central list */ private function getInsertQuery( - $column, + string $column, array $def, - $db, - $central_list_table - ) { + string $db, + string $central_list_table + ): string { $type = ""; $length = 0; $attribute = ""; @@ -292,8 +292,8 @@ class CentralColumns */ public function syncUniqueColumns( array $field_select, - $isTable = true, - $table = null + bool $isTable = true, + ?string $table = null ) { $cfgCentralColumns = $this->getParams(); if (empty($cfgCentralColumns)) { @@ -400,7 +400,7 @@ class CentralColumns */ public function deleteColumnsFromList( array $field_select, - $isTable = true + bool $isTable = true ) { $cfgCentralColumns = $this->getParams(); if (empty($cfgCentralColumns)) { @@ -484,7 +484,7 @@ class CentralColumns * @return true|PhpMyAdmin\Message */ public function makeConsistentWithList( - $db, + string $db, array $selected_tables ) { $message = true; @@ -556,10 +556,10 @@ class CentralColumns * @return array columns present in central list from given table of given db. */ public function getFromTable( - $db, - $table, - $allFields = false - ) { + string $db, + string $table, + bool $allFields = false + ): array { $cfgCentralColumns = $this->getParams(); if (empty($cfgCentralColumns)) { return array(); @@ -598,16 +598,16 @@ class CentralColumns * @return true|PhpMyAdmin\Message */ public function updateOneColumn( - $db, - $orig_col_name, - $col_name, - $col_type, - $col_attribute, - $col_length, - $col_isNull, - $collation, - $col_extra, - $col_default + string $db, + string $orig_col_name, + string $col_name, + string $col_type, + string $col_attribute, + string $col_length, + int $col_isNull, + string $collation, + string $col_extra, + string $col_default ) { $cfgCentralColumns = $this->getParams(); if (empty($cfgCentralColumns)) { @@ -699,8 +699,11 @@ class CentralColumns * * @return string html for table navigation in Central columns page */ - public function getHtmlForTableNavigation($total_rows, $pos, $db) - { + public function getHtmlForTableNavigation( + int $total_rows, + int $pos, + string $db + ): string { $pageNow = ($pos / $this->maxRows) + 1; $nbTotalPage = ceil($total_rows / $this->maxRows); $page_selector = ($nbTotalPage > 1)?(Util::pageselector( @@ -725,8 +728,11 @@ class CentralColumns * * @return string html for table header in central columns view/edit page */ - public function getTableHeader($class = '', $title = '', $actionCount = 0) - { + public function getTableHeader( + string $class = '', + string $title = '', + int $actionCount = 0 + ): string { $action = ''; if ($actionCount > 0) { $action .= '