Skip to content

Commit 3d30109

Browse files
committed
Fix an issue reported by Psalm
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
1 parent dc70903 commit 3d30109

6 files changed

Lines changed: 5 additions & 14 deletions

File tree

libraries/classes/Common.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ public static function run(): void
9090
$GLOBALS['auth_plugin'] = $GLOBALS['auth_plugin'] ?? null;
9191
$GLOBALS['theme'] = $GLOBALS['theme'] ?? null;
9292
$GLOBALS['urlParams'] = $GLOBALS['urlParams'] ?? null;
93-
$GLOBALS['isMinimumCommon'] = $GLOBALS['isMinimumCommon'] ?? null;
9493
$GLOBALS['token_mismatch'] = $GLOBALS['token_mismatch'] ?? null;
9594

9695
$request = self::getRequest();

libraries/classes/Config.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,8 +429,6 @@ private function setConnectionCollation(): void
429429
*/
430430
public function loadUserPreferences(): void
431431
{
432-
$GLOBALS['isMinimumCommon'] = $GLOBALS['isMinimumCommon'] ?? null;
433-
434432
// index.php should load these settings, so that phpmyadmin.css.php
435433
// will have everything available in session cache
436434
$server = $GLOBALS['server'] ?? (! empty($GLOBALS['cfg']['ServerDefault'])

psalm-baseline.xml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -249,14 +249,13 @@
249249
<code>$GLOBALS['cfg']['MysqlMinVersion']['internal']</code>
250250
<code>$GLOBALS['cfg']['Server']['user']</code>
251251
</MixedArrayAccess>
252-
<MixedAssignment occurrences="15">
252+
<MixedAssignment occurrences="14">
253253
<code>$GLOBALS['auth_plugin']</code>
254254
<code>$GLOBALS['back']</code>
255255
<code>$GLOBALS['back']</code>
256256
<code>$GLOBALS['cfg']</code>
257257
<code>$GLOBALS['goto']</code>
258258
<code>$GLOBALS['isConfigLoading']</code>
259-
<code>$GLOBALS['isMinimumCommon']</code>
260259
<code>$GLOBALS['server']</code>
261260
<code>$GLOBALS['sql_query']</code>
262261
<code>$GLOBALS['theme']</code>
@@ -345,10 +344,9 @@
345344
<code>$this-&gt;settings['Servers'][$server]</code>
346345
<code>$this-&gt;settings['Servers'][$this-&gt;settings['ServerDefault']]</code>
347346
</MixedArrayOffset>
348-
<MixedAssignment occurrences="30">
347+
<MixedAssignment occurrences="29">
349348
<code>$GLOBALS['cfg']['LoginCookieValidity']</code>
350349
<code>$GLOBALS['isConfigLoading']</code>
351-
<code>$GLOBALS['isMinimumCommon']</code>
352350
<code>$collation_connection</code>
353351
<code>$config_data</code>
354352
<code>$default_value</code>
@@ -16601,9 +16599,4 @@
1660116599
<code>is_string($text)</code>
1660216600
</RedundantConditionGivenDocblockType>
1660316601
</file>
16604-
<file src="url.php">
16605-
<UnusedVariable occurrences="1">
16606-
<code>$isMinimumCommon</code>
16607-
</UnusedVariable>
16608-
</file>
1660916602
</files>

psalm.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@
255255
import_file: string,
256256
import_file_name: string,
257257
import_text: string,
258+
isMinimumCommon?: true,
258259
is_create_db_priv: bool,
259260
is_reload_priv: bool,
260261
knjenc: string,

setup/lib/common.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
// use default error handler
4040
restore_error_handler();
4141

42-
// Save current language in a cookie, required since we set $isMinimumCommon
42+
// Save current language in a cookie, required since we set $GLOBALS['isMinimumCommon']
4343
$GLOBALS['config']->setCookie('pma_lang', (string) $GLOBALS['lang']);
4444
$GLOBALS['config']->set('is_setup', true);
4545

url.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
require AUTOLOAD_FILE;
3737

38-
$isMinimumCommon = true;
38+
$GLOBALS['isMinimumCommon'] = true;
3939

4040
Common::run();
4141

0 commit comments

Comments
 (0)