Visitar URL original
Merge pull request #18284 from MauricioFauth/config-overrides · phpmyadmin/phpmyadmin@6570089 · GitHub
Skip to content

Commit 6570089

Browse files
Merge pull request #18284 from MauricioFauth/config-overrides
Remove the _overrides key of the ConfigFile::$cfgDb
2 parents f243cf5 + 9d19822 commit 6570089

3 files changed

Lines changed: 1 addition & 33 deletions

File tree

‎libraries/classes/Config/ConfigFile.php‎

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,6 @@ public function __construct(array|null $baseConfig = null)
8989
// load additional config information
9090
$this->cfgDb = $this->getAllowedValues();
9191

92-
// apply default values overrides
93-
if (count($this->cfgDb['_overrides'])) {
94-
foreach ($this->cfgDb['_overrides'] as $path => $value) {
95-
Core::arrayWrite($path, $this->defaultCfg, $value);
96-
}
97-
}
98-
9992
$this->baseCfg = $baseConfig;
10093
$this->isInSetup = $baseConfig === null;
10194
$this->id = 'ConfigFile' . $GLOBALS['server'];
@@ -290,8 +283,7 @@ public function get(string $path, mixed $default = null): mixed
290283

291284
/**
292285
* Returns default config value or $default it it's not set ie. it doesn't
293-
* exist in {@see \PhpMyAdmin\Config\Settings} ($cfg) and config.values.php
294-
* ($_cfg_db['_overrides'])
286+
* exist in {@see \PhpMyAdmin\Config\Settings} ($cfg).
295287
*
296288
* @param string $canonicalPath Canonical path
297289
* @param mixed $default Default value
@@ -850,12 +842,6 @@ public function getAllowedValues(): array
850842
],
851843
],
852844

853-
/**
854-
* Default values overrides
855-
* Use only full paths
856-
*/
857-
'_overrides' => [],
858-
859845
/**
860846
* Basic validator assignments (functions from libraries/config/Validator.php
861847
* and 'window.validators' object in js/config.js)

‎phpstan-baseline.neon‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,6 @@ parameters:
220220
count: 1
221221
path: libraries/classes/Config.php
222222

223-
-
224-
message: "#^Argument of an invalid type array\\|string supplied for foreach, only iterables are supported\\.$#"
225-
count: 1
226-
path: libraries/classes/Config/ConfigFile.php
227-
228223
-
229224
message: "#^Method PhpMyAdmin\\\\Config\\\\ConfigFile\\:\\:__construct\\(\\) has parameter \\$baseConfig with no value type specified in iterable type array\\.$#"
230225
count: 1
@@ -315,11 +310,6 @@ parameters:
315310
count: 1
316311
path: libraries/classes/Config/ConfigFile.php
317312

318-
-
319-
message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, array\\|string given\\.$#"
320-
count: 1
321-
path: libraries/classes/Config/ConfigFile.php
322-
323313
-
324314
message: "#^Parameter \\#2 \\$array of static method PhpMyAdmin\\\\Core\\:\\:arrayRead\\(\\) expects array, array\\|null given\\.$#"
325315
count: 1

‎psalm-baseline.xml‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,6 @@
377377
<code>$k</code>
378378
<code>$mapTo</code>
379379
<code>$mapTo</code>
380-
<code>$path</code>
381380
</MixedArgumentTypeCoercion>
382381
<MixedArrayAccess>
383382
<code><![CDATA[$_SESSION[$this->id]['Servers'][$i + 1]]]></code>
@@ -404,7 +403,6 @@
404403
<code>$result[$prefix . $key]</code>
405404
<code>$value</code>
406405
<code>$value</code>
407-
<code>$value</code>
408406
<code>$verbose</code>
409407
</MixedAssignment>
410408
<MixedInferredReturnType>
@@ -427,9 +425,6 @@
427425
<code><![CDATA[empty($host) ? 'localhost' : $host]]></code>
428426
<code><![CDATA[empty($host) ? 'localhost' : $host]]></code>
429427
</MixedReturnStatement>
430-
<PossiblyInvalidArgument>
431-
<code><![CDATA[$this->cfgDb['_overrides']]]></code>
432-
</PossiblyInvalidArgument>
433428
<PossiblyInvalidArrayOffset>
434429
<code><![CDATA[$_SESSION[$this->id]]]></code>
435430
<code><![CDATA[$_SESSION[$this->id]]]></code>
@@ -439,9 +434,6 @@
439434
<code><![CDATA[$_SESSION[$this->id]]]></code>
440435
<code><![CDATA[$_SESSION[$this->id]]]></code>
441436
</PossiblyInvalidArrayOffset>
442-
<PossiblyInvalidIterator>
443-
<code><![CDATA[$this->cfgDb['_overrides']]]></code>
444-
</PossiblyInvalidIterator>
445437
<PossiblyNullArgument>
446438
<code><![CDATA[$this->baseCfg]]></code>
447439
</PossiblyNullArgument>

0 commit comments

Comments
 (0)