From 9db72b5f6270b3fec4339036c210b041cccc9bea Mon Sep 17 00:00:00 2001 From: Kamil Tekiela Date: Fri, 27 Sep 2024 22:30:41 +0100 Subject: [PATCH] Remove invalid type union Signed-off-by: Kamil Tekiela --- phpstan-baseline.neon | 5 ----- psalm-baseline.xml | 3 --- src/ConfigStorage/Relation.php | 20 ++++++++++---------- 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 27978e694c..fa0bc51caa 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1255,11 +1255,6 @@ parameters: count: 2 path: src/ConfigStorage/Relation.php - - - message: "#^Parameter \\#1 \\$foreigners of method PhpMyAdmin\\\\ConfigStorage\\\\Relation\\:\\:searchColumnInForeigners\\(\\) expects array, array\\|true given\\.$#" - count: 1 - path: src/ConfigStorage/Relation.php - - message: "#^Parameter \\#1 \\$identifier of static method PhpMyAdmin\\\\Util\\:\\:backquote\\(\\) expects string\\|Stringable\\|null, mixed given\\.$#" count: 7 diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 6262b395f3..2ddd49f11c 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -755,9 +755,6 @@ config->selectedServer['column_info']]]> config->selectedServer['column_info']]]> - - - diff --git a/src/ConfigStorage/Relation.php b/src/ConfigStorage/Relation.php index bcbb74be16..7162990749 100644 --- a/src/ConfigStorage/Relation.php +++ b/src/ConfigStorage/Relation.php @@ -887,17 +887,17 @@ class Relation /** * Gets foreign keys in preparation for a drop-down selector * - * @param mixed[]|bool $foreigners array of the foreign keys - * @param string $field the foreign field name - * @param bool $overrideTotal whether to override the total - * @param string $foreignFilter a possible filter - * @param string $foreignLimit a possible LIMIT clause - * @param bool $getTotal optional, whether to get total num of rows - * in $foreignData['the_total;] - * (has an effect of performance) + * @param mixed[] $foreigners array of the foreign keys + * @param string $field the foreign field name + * @param bool $overrideTotal whether to override the total + * @param string $foreignFilter a possible filter + * @param string $foreignLimit a possible LIMIT clause + * @param bool $getTotal optional, whether to get total num of rows + * in $foreignData['the_total;] + * (has an effect of performance) */ public function getForeignData( - array|bool $foreigners, + array $foreigners, string $field, bool $overrideTotal, string $foreignFilter, @@ -909,7 +909,7 @@ class Relation $foreignLink = false; $dispRow = $foreignDisplay = $theTotal = $foreignField = null; do { - if ($foreigners === false || $foreigners === []) { + if ($foreigners === []) { break; }