diff --git a/db_tracking.php b/db_tracking.php index 98b2885260..fb508b5004 100644 --- a/db_tracking.php +++ b/db_tracking.php @@ -101,7 +101,7 @@ if (isset($_POST['delete_tracking']) && isset($_POST['table'])) { $data = Tracker::getTrackedData($db, '', '1'); // No tables present and no log exist -if ($num_tables == 0 && count($data['ddlog']) == 0) { +if ($num_tables == 0 && count($data['ddlog']) === 0) { echo '
' , __('No tables found in database.') , '
' , "\n"; if (empty($db_is_system_schema)) { diff --git a/export.php b/export.php index c521e233c3..4798045534 100644 --- a/export.php +++ b/export.php @@ -411,7 +411,7 @@ if ($save_on_server) { // HTML if ($export_type == 'database') { $num_tables = count($tables); - if ($num_tables == 0) { + if ($num_tables === 0) { $message = PhpMyAdmin\Message::error( __('No tables found in database.') ); diff --git a/libraries/classes/CentralColumns.php b/libraries/classes/CentralColumns.php index 0ae85cfd20..873a1fb8c5 100644 --- a/libraries/classes/CentralColumns.php +++ b/libraries/classes/CentralColumns.php @@ -1053,7 +1053,7 @@ class CentralColumns //get current values of $db from central column list $query = 'SELECT COUNT(db_name) FROM ' . Util::backquote($central_list_table) . ' ' . 'WHERE db_name = \'' . $this->dbi->escapeString($db) . '\'' . - ($num == 0 ? '' : 'LIMIT ' . $from . ', ' . $num) . ';'; + ($num === 0 ? '' : 'LIMIT ' . $from . ', ' . $num) . ';'; $result = (array) $this->dbi->fetchResult( $query, null, diff --git a/libraries/classes/Config.php b/libraries/classes/Config.php index 711284ca4f..224c8d6af9 100644 --- a/libraries/classes/Config.php +++ b/libraries/classes/Config.php @@ -1717,7 +1717,7 @@ class Config public function checkServers(): void { // Do we have some server? - if (! isset($this->settings['Servers']) || count($this->settings['Servers']) == 0) { + if (! isset($this->settings['Servers']) || count($this->settings['Servers']) === 0) { // No server => create one with defaults $this->settings['Servers'] = [1 => $this->default_server]; } else { diff --git a/libraries/classes/Config/FormDisplay.php b/libraries/classes/Config/FormDisplay.php index 492d1d0db1..500706cb12 100644 --- a/libraries/classes/Config/FormDisplay.php +++ b/libraries/classes/Config/FormDisplay.php @@ -519,7 +519,7 @@ class FormDisplay public function displayErrors() { $this->_validate(); - if (count($this->_errors) == 0) { + if (count($this->_errors) === 0) { return null; } @@ -545,7 +545,7 @@ class FormDisplay public function fixErrors() { $this->_validate(); - if (count($this->_errors) == 0) { + if (count($this->_errors) === 0) { return; } diff --git a/libraries/classes/Controllers/HomeController.php b/libraries/classes/Controllers/HomeController.php index 27d76cf5ef..17a9a1b0bf 100644 --- a/libraries/classes/Controllers/HomeController.php +++ b/libraries/classes/Controllers/HomeController.php @@ -88,7 +88,7 @@ class HomeController extends AbstractController $hasServerSelection = $cfg['ServerDefault'] == 0 || (! $cfg['NavigationDisplayServers'] && (count($cfg['Servers']) > 1 - || ($server == 0 && count($cfg['Servers']) == 1))); + || ($server == 0 && count($cfg['Servers']) === 1))); if ($hasServerSelection) { $serverSelection = Select::render(true, true); } diff --git a/libraries/classes/Controllers/Server/DatabasesController.php b/libraries/classes/Controllers/Server/DatabasesController.php index 6e82a1875b..b12ce09409 100644 --- a/libraries/classes/Controllers/Server/DatabasesController.php +++ b/libraries/classes/Controllers/Server/DatabasesController.php @@ -321,7 +321,7 @@ class DatabasesController extends AbstractController ); if (strlen((string) $key) > 0 - || count($replication_info[$type]['Do_DB']) == 0 + || count($replication_info[$type]['Do_DB']) === 0 ) { // if ($key != null) did not work for index "0" $replication[$type]['is_replicated'] = true; diff --git a/libraries/classes/Controllers/Setup/HomeController.php b/libraries/classes/Controllers/Setup/HomeController.php index 4680dad4c8..95de265e14 100644 --- a/libraries/classes/Controllers/Setup/HomeController.php +++ b/libraries/classes/Controllers/Setup/HomeController.php @@ -129,7 +129,7 @@ class HomeController extends AbstractController if ($this->config->getServerCount() > 0) { $serverDefaultOptions['values']['0'] = __('let the user choose'); $serverDefaultOptions['values']['-'] = '------------------------------'; - if ($this->config->getServerCount() == 1) { + if ($this->config->getServerCount() === 1) { $serverDefaultOptions['values_disabled'][] = '0'; } $serverDefaultOptions['values_disabled'][] = '-'; diff --git a/libraries/classes/Controllers/Table/StructureController.php b/libraries/classes/Controllers/Table/StructureController.php index 7add337f59..d4b358367a 100644 --- a/libraries/classes/Controllers/Table/StructureController.php +++ b/libraries/classes/Controllers/Table/StructureController.php @@ -191,7 +191,7 @@ class StructureController extends AbstractController if (Context::isKeyword(trim($this->table), true)) { $reserved_keywords_names[] = trim($this->table); } - if (count($reserved_keywords_names) == 0) { + if (count($reserved_keywords_names) === 0) { $this->response->setRequestStatus(false); } $this->response->addJSON( @@ -541,7 +541,7 @@ class StructureController extends AbstractController $selected[$i], true ); - if (count($value) == 0) { + if (count($value) === 0) { $message = Message::error( __('Failed to get description of column %s!') ); diff --git a/libraries/classes/Core.php b/libraries/classes/Core.php index a2700cdd85..581afbc9ef 100644 --- a/libraries/classes/Core.php +++ b/libraries/classes/Core.php @@ -735,7 +735,7 @@ class Core // remove empty nested arrays for (; $depth >= 0; $depth--) { - if (! isset($path[$depth + 1]) || count($path[$depth + 1]) == 0) { + if (! isset($path[$depth + 1]) || count($path[$depth + 1]) === 0) { unset($path[$depth][$keys[$depth]]); } else { break; diff --git a/libraries/classes/Database/Qbe.php b/libraries/classes/Database/Qbe.php index 7927f1dd98..1e7ce8498d 100644 --- a/libraries/classes/Database/Qbe.php +++ b/libraries/classes/Database/Qbe.php @@ -1367,7 +1367,7 @@ class Qbe array $where_clause_columns, array $where_clause_tables ) { - if (count($where_clause_tables) == 1) { + if (count($where_clause_tables) === 1) { // If there is exactly one column that has a decent where-clause // we will just use this return key($where_clause_tables); @@ -1614,7 +1614,7 @@ class Qbe } // We are done if no unfinalized tables anymore - if (count($tempUnfinalized) == 0) { + if (count($tempUnfinalized) === 0) { break 3; } } diff --git a/libraries/classes/DatabaseInterface.php b/libraries/classes/DatabaseInterface.php index cd796310ca..2505cebf90 100644 --- a/libraries/classes/DatabaseInterface.php +++ b/libraries/classes/DatabaseInterface.php @@ -1331,7 +1331,7 @@ class DatabaseInterface ): array { $sql = $this->getColumnsSql($database, $table, $column, $full); $fields = $this->fetchResult($sql, 'Field', null, $link); - if (! is_array($fields) || count($fields) == 0) { + if (! is_array($fields) || count($fields) === 0) { return []; } // Check if column is a part of multiple-column index and set its 'Key'. @@ -1379,7 +1379,7 @@ class DatabaseInterface // We only need the 'Field' column which contains the table's column names $fields = array_keys($this->fetchResult($sql, 'Field', null, $link)); - if (! is_array($fields) || count($fields) == 0) { + if (! is_array($fields) || count($fields) === 0) { return null; } return $fields; @@ -2418,7 +2418,7 @@ class DatabaseInterface */ public function getCurrentUserAndHost(): array { - if (count($this->_current_user) == 0) { + if (count($this->_current_user) === 0) { $user = $this->getCurrentUser(); $this->_current_user = explode("@", $user); } diff --git a/libraries/classes/Display/Results.php b/libraries/classes/Display/Results.php index f0c26d19b2..79c7583c60 100644 --- a/libraries/classes/Display/Results.php +++ b/libraries/classes/Display/Results.php @@ -727,7 +727,7 @@ class Results || $this->__get('is_analyse')) && ! empty($analyzed_sql_results['select_from']) && ! empty($analyzed_sql_results['statement']->from) - && (count($analyzed_sql_results['statement']->from) == 1) + && (count($analyzed_sql_results['statement']->from) === 1) && ! empty($analyzed_sql_results['statement']->from[0]->table); } @@ -4923,7 +4923,7 @@ class Results && ! isset($printview) && empty($analyzed_sql_results['procedure']) ) { - if (count($analyzed_sql_results['select_tables']) == 1) { + if (count($analyzed_sql_results['select_tables']) === 1) { $_url_params['single_table'] = 'true'; } diff --git a/libraries/classes/Import.php b/libraries/classes/Import.php index 9f1d579671..7f4187d812 100644 --- a/libraries/classes/Import.php +++ b/libraries/classes/Import.php @@ -827,7 +827,7 @@ class Import if ($cell == (string) (float) $cell && mb_strpos($cell, ".") !== false - && mb_substr_count($cell, ".") == 1 + && mb_substr_count($cell, ".") === 1 ) { return self::DECIMAL; } @@ -1212,7 +1212,7 @@ class Import for ($i = 0; $i < $additional_sql_len; ++$i) { preg_match($view_pattern, $additional_sql[$i], $regs); - if (count($regs) == 0) { + if (count($regs) === 0) { preg_match($table_pattern, $additional_sql[$i], $regs); } @@ -1681,7 +1681,7 @@ class Import public function isTableTransactional(string $table): bool { $table = explode('.', $table); - if (count($table) == 2) { + if (count($table) === 2) { $db = Util::unQuote($table[0]); $table = Util::unQuote($table[1]); } else { diff --git a/libraries/classes/Navigation/NavigationTree.php b/libraries/classes/Navigation/NavigationTree.php index 8e675f4bcd..6dde677e57 100644 --- a/libraries/classes/Navigation/NavigationTree.php +++ b/libraries/classes/Navigation/NavigationTree.php @@ -383,7 +383,7 @@ class NavigationTree return $retval; } - if (count($containers) == 1) { + if (count($containers) === 1) { $container = array_shift($containers); } else { $container = $db->getChild($path[0], true); @@ -759,7 +759,7 @@ class NavigationTree } } // rfe #1634 Don't group if there's only one group and no other items - if (count($prefixes) == 1) { + if (count($prefixes) === 1) { $keys = array_keys($prefixes); $key = $keys[0]; if ($prefixes[$key] == count($node->children) - 1) { @@ -1059,7 +1059,7 @@ class NavigationTree ) { $response = Response::getInstance(); if ($node->type == Node::CONTAINER - && count($node->children) == 0 + && count($node->children) === 0 && ! $response->isAjax() ) { return ''; diff --git a/libraries/classes/Normalization.php b/libraries/classes/Normalization.php index bdbcea40c5..a2e403caa6 100644 --- a/libraries/classes/Normalization.php +++ b/libraries/classes/Normalization.php @@ -509,7 +509,7 @@ class Normalization __('The second step of normalization is complete for table \'%1$s\'.'), htmlspecialchars($table) ) . ''; - if (count((array) $partialDependencies) == 1) { + if (count((array) $partialDependencies) === 1) { return [ 'legendText' => __('End of step'), 'headText' => $headText, @@ -582,7 +582,7 @@ class Normalization $i = 1; $newTables = []; foreach ($tables as $table => $arrDependson) { - if (count(array_unique($arrDependson)) == 1) { + if (count(array_unique($arrDependson)) === 1) { continue; } $primary = Index::getPrimary($table, $db); @@ -648,7 +648,7 @@ class Normalization $headText = '