refactor naming & superfluous check

2022.09-rc
Philipp Holzer 2019-03-17 09:57:34 +01:00
rodzic 8c6e6b5dea
commit b22ff7419e
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 517BE60E2CE5C8A5
2 zmienionych plików z 7 dodań i 7 usunięć

Wyświetl plik

@ -30,7 +30,7 @@ class ConfigCache implements IConfigCache, IPConfigCache
$categories = array_keys($config);
foreach ($categories as $category) {
if (isset($config[$category]) && is_array($config[$category])) {
if (is_array($config[$category])) {
$keys = array_keys($config[$category]);
foreach ($keys as $key) {

Wyświetl plik

@ -110,18 +110,18 @@ class ConfigCacheLoader
$a->config = [];
include $filePath;
$htconfigAr = array_keys($a->config);
$htConfigCategories = array_keys($a->config);
// map the legacy configuration structure to the current structure
foreach ($htconfigAr as $htconfig) {
if (isset($a->config[$htconfig]) && is_array($a->config[$htconfig])) {
$keys = array_keys($a->config[$htconfig]);
foreach ($htConfigCategories as $htConfigCategory) {
if (is_array($a->config[$htConfigCategory])) {
$keys = array_keys($a->config[$htConfigCategory]);
foreach ($keys as $key) {
$config[$htconfig][$key] = $a->config[$htconfig][$key];
$config[$htConfigCategory][$key] = $a->config[$htConfigCategory][$key];
}
} else {
$config['config'][$htconfig] = $a->config[$htconfig];
$config['config'][$htConfigCategory] = $a->config[$htConfigCategory];
}
}