From f874bf1d998704020fed3b4cce6cb791b8bb33c1 Mon Sep 17 00:00:00 2001 From: Kamil Tekiela Date: Tue, 21 Feb 2023 14:45:59 +0000 Subject: [PATCH] Remove generateRowQueryOutput() method Signed-off-by: Kamil Tekiela --- libraries/classes/Html/Generator.php | 41 ---------------------------- phpstan-baseline.neon | 10 +++---- psalm-baseline.xml | 21 +++++++------- 3 files changed, 16 insertions(+), 56 deletions(-) diff --git a/libraries/classes/Html/Generator.php b/libraries/classes/Html/Generator.php index af64c4aff7..3adb68bf0f 100644 --- a/libraries/classes/Html/Generator.php +++ b/libraries/classes/Html/Generator.php @@ -414,47 +414,6 @@ class Generator return ['pos' => $pos, 'unlim_num_rows' => $numberOfLine, 'rows' => $rows, 'sql_query' => $sqlQuery]; } - /** - * Execute an EXPLAIN query and formats results similar to MySQL command line - * utility. - * - * @param string $sqlQuery EXPLAIN query - * - * @return string query results - */ - private static function generateRowQueryOutput($sqlQuery): string - { - $ret = ''; - $result = $GLOBALS['dbi']->query($sqlQuery); - $devider = '+'; - $columnNames = '|'; - $fieldsMeta = $GLOBALS['dbi']->getFieldsMeta($result); - foreach ($fieldsMeta as $meta) { - $devider .= '---+'; - $columnNames .= ' ' . $meta->name . ' |'; - } - - $devider .= "\n"; - - $ret .= $devider . $columnNames . "\n" . $devider; - while ($row = $result->fetchRow()) { - $values = '|'; - foreach ($row as $value) { - if ($value === null) { - $value = 'NULL'; - } - - $values .= ' ' . $value . ' |'; - } - - $ret .= $values . "\n"; - } - - $ret .= $devider; - - return $ret; - } - /** * Prepare the message and the query * usually the message is the result of the query executed diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 82ae107634..4d20866f63 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -5635,6 +5635,11 @@ parameters: count: 1 path: libraries/classes/Message.php + - + message: "#^Right side of && is always true\\.$#" + count: 1 + path: libraries/classes/Message.php + - message: "#^Method PhpMyAdmin\\\\Navigation\\\\Navigation\\:\\:getHiddenItems\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -10395,11 +10400,6 @@ parameters: count: 4 path: test/classes/Display/ResultsTest.php - - - message: "#^Strict comparison using \\=\\=\\= between 4 and 4 will always evaluate to true\\.$#" - count: 1 - path: test/classes/EncodingTest.php - - message: "#^Method PhpMyAdmin\\\\Tests\\\\Engines\\\\PbxtTest\\:\\:providerFortTestResolveTypeSize\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 diff --git a/psalm-baseline.xml b/psalm-baseline.xml index c1954aa274..05e6a8071e 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,5 +1,5 @@ - + $matches[1] @@ -8871,9 +8871,6 @@ - - generateRowQueryOutput - @@ -9085,9 +9082,6 @@ - - 50000]]> - @@ -10650,6 +10644,9 @@ $tmp_host + + $password + removeCookie removeCookie @@ -12000,9 +11997,6 @@ - - - @@ -14371,6 +14365,10 @@ + + + + @@ -15659,6 +15657,9 @@ + + $separator + escapeString escapeString