From d1c2c6e07dcca2c665737c67165a04628d45444f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Fri, 9 Jun 2023 18:38:25 -0300 Subject: [PATCH] Fix error reported by PHPStan MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: MaurĂ­cio Meneghini Fauth --- libraries/classes/Plugins/Export/ExportSql.php | 2 +- phpstan-baseline.neon | 15 --------------- psalm-baseline.xml | 7 ------- 3 files changed, 1 insertion(+), 23 deletions(-) diff --git a/libraries/classes/Plugins/Export/ExportSql.php b/libraries/classes/Plugins/Export/ExportSql.php index c91639e0f7..71220d059c 100644 --- a/libraries/classes/Plugins/Export/ExportSql.php +++ b/libraries/classes/Plugins/Export/ExportSql.php @@ -1575,7 +1575,7 @@ class ExportSql extends ExportPlugin } // Creating the parts that drop foreign keys. - if ($field->key !== null && $field->key->type === 'FOREIGN KEY') { + if ($field->key !== null && $field->key->type === 'FOREIGN KEY' && $field->name !== null) { $dropped[] = 'FOREIGN KEY ' . Context::escape($field->name); unset($statement->fields[$key]); } diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 9051dde58c..4680a7b519 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -5245,11 +5245,6 @@ parameters: count: 1 path: libraries/classes/Plugins/Export/ExportPhparray.php - - - message: "#^Binary operation \"\\.\" between 'FOREIGN KEY ' and array\\\\|string results in an error\\.$#" - count: 1 - path: libraries/classes/Plugins/Export/ExportSql.php - - message: "#^Cannot access offset 'alias' on mixed\\.$#" count: 8 @@ -5360,11 +5355,6 @@ parameters: count: 1 path: libraries/classes/Plugins/Export/ExportSql.php - - - message: "#^Parameter \\#1 \\$str of static method PhpMyAdmin\\\\SqlParser\\\\Context\\:\\:escape\\(\\) expects array\\\\|string, string\\|null given\\.$#" - count: 1 - path: libraries/classes/Plugins/Export/ExportSql.php - - message: "#^Parameter \\#1 \\$string of function strtoupper expects string, mixed given\\.$#" count: 1 @@ -5400,11 +5390,6 @@ parameters: count: 1 path: libraries/classes/Plugins/Export/ExportSql.php - - - message: "#^Property PhpMyAdmin\\\\SqlParser\\\\Token\\:\\:\\$token \\(string\\) does not accept array\\\\|string\\.$#" - count: 1 - path: libraries/classes/Plugins/Export/ExportSql.php - - message: "#^Cannot access offset 'action_timing' on mixed\\.$#" count: 1 diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 9754ea64db..faf003bbe1 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -8817,16 +8817,9 @@ - - name)]]> - - - Context::escape($alias) - $createQuery $definition - name]]> $tableAlias $tableAlias $tableAlias