Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaurício Meneghini Fauth <mauricio@fauth.dev>2022-06-11 20:13:30 +0300
committerMaurício Meneghini Fauth <mauricio@fauth.dev>2022-06-11 20:13:30 +0300
commit905214ae0b43d2a40acd435f0c9dbf370ade6c71 (patch)
treec315f83abda693f1bcda56fc7283b480061f43e3
parentec2baccb3584456943c5cc599f2a58e44e24c562 (diff)
parentbf084233ea530115beea9df034f873a075f6da2e (diff)
Merge branch 'QA_5_2'
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
-rw-r--r--ChangeLog1
-rw-r--r--libraries/classes/Controllers/Server/DatabasesController.php4
-rw-r--r--phpstan-baseline.neon5
-rw-r--r--psalm-baseline.xml12
4 files changed, 6 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index 3dcd95a985..23de69eb69 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -16,6 +16,7 @@ phpMyAdmin - ChangeLog
- issue #17366 Fix refresh rate popup on Monitor page
- issue #17577 Fix monitor charts size on RTL languages
- issue #17121 Fix password_hash function incorrectly adding single quotes to password before hashing
+- issue #17586 Fix statistics not showing for empty databases
5.2.0 (2022-05-10)
- issue #16521 Upgrade Bootstrap to version 5
diff --git a/libraries/classes/Controllers/Server/DatabasesController.php b/libraries/classes/Controllers/Server/DatabasesController.php
index 1012a76233..09f4d65f3e 100644
--- a/libraries/classes/Controllers/Server/DatabasesController.php
+++ b/libraries/classes/Controllers/Server/DatabasesController.php
@@ -257,8 +257,8 @@ class DatabasesController extends AbstractController
$statistics = $this->getStatisticsColumns();
if ($this->hasStatistics) {
foreach (array_keys($statistics) as $key) {
- $statistics[$key]['raw'] = $database[$key] ?? null;
- $totalStatistics[$key]['raw'] += (int) $database[$key] ?? 0;
+ $statistics[$key]['raw'] = (int) ($database[$key] ?? 0);
+ $totalStatistics[$key]['raw'] += (int) ($database[$key] ?? 0);
}
}
diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon
index 243cb9aeea..b7a489eec5 100644
--- a/phpstan-baseline.neon
+++ b/phpstan-baseline.neon
@@ -1256,11 +1256,6 @@ parameters:
path: libraries/classes/Controllers/Server/BinlogController.php
-
- message: "#^Expression on left side of \\?\\? is not nullable\\.$#"
- count: 1
- path: libraries/classes/Controllers/Server/DatabasesController.php
-
- -
message: "#^Method PhpMyAdmin\\\\Controllers\\\\Server\\\\DatabasesController\\:\\:getDatabases\\(\\) has parameter \\$primaryInfo with no value type specified in iterable type array\\.$#"
count: 1
path: libraries/classes/Controllers/Server/DatabasesController.php
diff --git a/psalm-baseline.xml b/psalm-baseline.xml
index d4b085d70a..c25041a698 100644
--- a/psalm-baseline.xml
+++ b/psalm-baseline.xml
@@ -2656,7 +2656,8 @@
<MixedArgumentTypeCoercion occurrences="1">
<code>['db' =&gt; $database['SCHEMA_NAME']]</code>
</MixedArgumentTypeCoercion>
- <MixedArrayAccess occurrences="13">
+ <MixedArrayAccess occurrences="14">
+ <code>$database[$key]</code>
<code>$database[$key]</code>
<code>$database['DEFAULT_COLLATION_NAME']</code>
<code>$database['SCHEMA_NAME']</code>
@@ -2679,7 +2680,7 @@
<code>$databases[$database['SCHEMA_NAME']]</code>
<code>$databases[$database['SCHEMA_NAME']]</code>
</MixedArrayOffset>
- <MixedAssignment occurrences="9">
+ <MixedAssignment occurrences="8">
<code>$GLOBALS['db_to_create']</code>
<code>$GLOBALS['errorUrl']</code>
<code>$database</code>
@@ -2687,7 +2688,6 @@
<code>$key</code>
<code>$key</code>
<code>$key</code>
- <code>$statistics[$key]['raw']</code>
<code>$totalStatistics[$key]['raw']</code>
</MixedAssignment>
<MixedOperand occurrences="1">
@@ -2705,12 +2705,6 @@
<code>$sortBy</code>
<code>$sortOrder</code>
</PropertyNotSetInConstructor>
- <RedundantCondition occurrences="1">
- <code>(int) $database[$key]</code>
- </RedundantCondition>
- <TypeDoesNotContainNull occurrences="1">
- <code>0</code>
- </TypeDoesNotContainNull>
</file>
<file src="libraries/classes/Controllers/Server/ExportController.php">
<MixedArgument occurrences="3">