From 8687c58db26ae2394878f9fe9a0ac72d537b200e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Wed, 7 Jun 2023 15:24:34 -0300 Subject: [PATCH] Replace SqlParser\Context::$MODE with getMode() and setMode() 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 | 8 ++++---- phpstan-baseline.neon | 5 ----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/libraries/classes/Plugins/Export/ExportSql.php b/libraries/classes/Plugins/Export/ExportSql.php index bc5788f7ed..c91639e0f7 100644 --- a/libraries/classes/Plugins/Export/ExportSql.php +++ b/libraries/classes/Plugins/Export/ExportSql.php @@ -1390,7 +1390,7 @@ class ExportSql extends ExportPlugin } // Old mode is stored so it can be restored once exporting is done. - $oldMode = Context::$MODE; + $oldMode = Context::getMode(); $warning = ''; @@ -1489,12 +1489,12 @@ class ExportSql extends ExportPlugin if (! $this->useSqlBackquotes) { // Option "Enclose table and column names with backquotes" // was checked. - Context::$MODE |= Context::SQL_MODE_NO_ENCLOSING_QUOTES; + Context::setMode(Context::getMode() | Context::SQL_MODE_NO_ENCLOSING_QUOTES); } // Using appropriate quotes. if ($compat === 'MSSQL') { - Context::$MODE |= Context::SQL_MODE_ANSI_QUOTES; + Context::setMode(Context::getMode() | Context::SQL_MODE_ANSI_QUOTES); } } @@ -1695,7 +1695,7 @@ class ExportSql extends ExportPlugin } // Restoring old mode. - Context::$MODE = $oldMode; + Context::setMode($oldMode); return $warning . $schemaCreate . ($addSemicolon ? ';' . "\n" : ''); } diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 7efbbed582..a1c7d0a535 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -4600,11 +4600,6 @@ parameters: count: 1 path: libraries/classes/Navigation/NavigationTree.php - - - message: "#^Method PhpMyAdmin\\\\Navigation\\\\NavigationTree\\:\\:parsePath\\(\\) should return non\\-empty\\-array\\ but returns non\\-empty\\-array\\\\.$#" - count: 1 - path: libraries/classes/Navigation/NavigationTree.php - - message: "#^Only numeric types are allowed in \\+, int\\|false given on the left side\\.$#" count: 1