]> git.mxchange.org Git - friendica.git/commitdiff
refactor naming & superfluous check
authorPhilipp Holzer <admin@philipp.info>
Sun, 17 Mar 2019 08:57:34 +0000 (09:57 +0100)
committerPhilipp Holzer <admin@philipp.info>
Sun, 17 Mar 2019 08:57:34 +0000 (09:57 +0100)
src/Core/Config/Cache/ConfigCache.php
src/Core/Config/Cache/ConfigCacheLoader.php

index cf50b43d4f4685fb1ba221ac8fa021aa9f559f65..cb299eb330956624e41eff564a074bd3973b0ed2 100644 (file)
@@ -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) {
index 8a2dc2b1e29f2ae6c4bc80dd99e60427dcbb77ba..55f18681ce7e002a01068fcb676a60f9fc80256a 100644 (file)
@@ -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];
                                }
                        }