From: Philipp Holzer Date: Sun, 17 Mar 2019 08:57:34 +0000 (+0100) Subject: refactor naming & superfluous check X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b22ff7419eedbf8247fe08c154b5ae352aca7a07;p=friendica.git refactor naming & superfluous check --- diff --git a/src/Core/Config/Cache/ConfigCache.php b/src/Core/Config/Cache/ConfigCache.php index cf50b43d4f..cb299eb330 100644 --- a/src/Core/Config/Cache/ConfigCache.php +++ b/src/Core/Config/Cache/ConfigCache.php @@ -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) { diff --git a/src/Core/Config/Cache/ConfigCacheLoader.php b/src/Core/Config/Cache/ConfigCacheLoader.php index 8a2dc2b1e2..55f18681ce 100644 --- a/src/Core/Config/Cache/ConfigCacheLoader.php +++ b/src/Core/Config/Cache/ConfigCacheLoader.php @@ -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]; } }