Completed
Pull Request — develop (#57)
by Tony
07:09
created
app/Models/DbConfig.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
 
50 50
     public function scopeKey($query, $key)
51 51
     {
52
-        return $query->where('config_name', 'LIKE', $key . '%');
52
+        return $query->where('config_name', 'LIKE', $key.'%');
53 53
     }
54 54
 
55 55
     public function scopeExactKey($query, $key)
Please login to merge, or discard this patch.
app/Settings.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
     public function get($key, $default = null)
63 63
     {
64 64
         // return value from cache or fetch it and return it
65
-        return Cache::remember($key, $this->cache_time, function () use ($key, $default) {
65
+        return Cache::remember($key, $this->cache_time, function() use ($key, $default) {
66 66
             $db_data = DbConfig::key($key)->get(['config_name', 'config_value']);
67 67
 
68 68
             if (count($db_data) == 1 && $db_data->first()->config_name == $key) {
@@ -71,14 +71,14 @@  discard block
 block discarded – undo
71 71
             }
72 72
             elseif (count($db_data) >= 1) {
73 73
                 $result = self::collectionToArray($db_data, $key);
74
-                $config = Config::get('config.' . $key, $default);
74
+                $config = Config::get('config.'.$key, $default);
75 75
                 if (!is_null($config)) {
76 76
                     $result = array_replace_recursive($config, $result);
77 77
                 }
78 78
                 return $result;
79 79
             }
80 80
             else {
81
-                return Config::get('config.' . $key, $default);
81
+                return Config::get('config.'.$key, $default);
82 82
             }
83 83
 
84 84
         });
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
     private static function recursive_keys(array $array, $prefix = "", array $path = array())
160 160
     {
161 161
         if ($prefix != "") {
162
-            $prefix = trim($prefix, '.') . '.';
162
+            $prefix = trim($prefix, '.').'.';
163 163
         }
164 164
         $result = array();
165 165
         foreach ($array as $key => $val) {
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
                 $result = array_merge($result, self::recursive_keys($val, $prefix, $currentPath));
169 169
             }
170 170
             else {
171
-                $result[$prefix . join('.', $currentPath)] = $val;
171
+                $result[$prefix.join('.', $currentPath)] = $val;
172 172
             }
173 173
         }
174 174
         return $result;
Please login to merge, or discard this patch.