From 730bea74acb24e270df76470583b8fdf0838bcbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Mon, 6 Mar 2023 18:33:34 -0300 Subject: [PATCH] Fix an issue detected by Psalm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: MaurĂ­cio Meneghini Fauth --- libraries/classes/Table.php | 5 +---- phpstan-baseline.neon | 5 ----- psalm-baseline.xml | 2 -- 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/libraries/classes/Table.php b/libraries/classes/Table.php index 3551b65365..9068907d5d 100644 --- a/libraries/classes/Table.php +++ b/libraries/classes/Table.php @@ -399,11 +399,8 @@ class Table implements Stringable public function getRowFormat(): string { $tableRowFormat = $this->getStatusInfo('ROW_FORMAT', false, true); - if ($tableRowFormat === false) { - return ''; - } - return $tableRowFormat ?? ''; + return is_string($tableRowFormat) ? $tableRowFormat : ''; } /** diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 9b1ea53ce9..0308de8ea9 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -8500,11 +8500,6 @@ parameters: count: 1 path: libraries/classes/Table.php - - - message: "#^Method PhpMyAdmin\\\\Table\\:\\:getRowFormat\\(\\) should return string but returns mixed\\.$#" - count: 1 - path: libraries/classes/Table.php - - message: "#^Method PhpMyAdmin\\\\Table\\:\\:getSQLToCreateForeignKey\\(\\) has parameter \\$field with no value type specified in iterable type array\\.$#" count: 1 diff --git a/psalm-baseline.xml b/psalm-baseline.xml index fbb76f80a9..99017035a6 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -13658,7 +13658,6 @@ string string string - string has @@ -13682,7 +13681,6 @@ $tableComment - $tableRowFormat errors)]]> messages)]]> json_decode($value, true)