Completed
Push — misc ( cfaf83...3fa631 )
by Tony
02:42
created
app/Settings.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -69,11 +69,11 @@  discard block
 block discarded – undo
69 69
                 if (!empty($key)) {
70 70
                     if (is_string($k) && !str_contains($k, '.') && DbConfig::exactKey($key)->exists() && DbConfig::key($key)->count() == 1) {
71 71
                         // check that we aren't trying to set an array onto an existing value only setting
72
-                        throw new \Exception("Attempting to set array value to existing non-array value at the key '" . $key . "'");
72
+                        throw new \Exception("Attempting to set array value to existing non-array value at the key '".$key."'");
73 73
                     }
74 74
                     else {
75 75
                         // we are not at the leaf yet, add this chunk to the key and recurse
76
-                        $this->set($key . '.' . $k, $v);
76
+                        $this->set($key.'.'.$k, $v);
77 77
                     }
78 78
                 }
79 79
                 else {
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
         else {
86 86
             // make sure we can save this
87 87
             if ($this->isReadOnly($key)) {
88
-                throw new \Exception("The setting '" . $key . "' is read only");
88
+                throw new \Exception("The setting '".$key."' is read only");
89 89
             }
90 90
 
91 91
             // flush the cache and save the value in db and cache
@@ -106,10 +106,10 @@  discard block
 block discarded – undo
106 106
     public function get($key, $default = null)
107 107
     {
108 108
         // return value from cache or fetch it and return it
109
-        return Cache::tags(self::$cache_tag)->remember($key, $this->cache_time, function () use ($key, $default) {
109
+        return Cache::tags(self::$cache_tag)->remember($key, $this->cache_time, function() use ($key, $default) {
110 110
             // fetch the value from config.php first
111
-            if (Config::has('config.' . $key)) {
112
-                $config_data = Config::get('config.' . $key, $default);
111
+            if (Config::has('config.'.$key)) {
112
+                $config_data = Config::get('config.'.$key, $default);
113 113
                 if (!is_array($config_data)) {
114 114
                     // return the value from config.php if it is a value
115 115
                     return $config_data;
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
      */
176 176
     public function has($key)
177 177
     {
178
-        return (Cache::tags(self::$cache_tag)->has($key) || Config::has('config.' . $key) || DbConfig::key($key)->exists());
178
+        return (Cache::tags(self::$cache_tag)->has($key) || Config::has('config.'.$key) || DbConfig::key($key)->exists());
179 179
     }
180 180
 
181 181
     /**
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
      */
187 187
     public function isReadOnly($key)
188 188
     {
189
-        return Config::has('config.' . $key);
189
+        return Config::has('config.'.$key);
190 190
     }
191 191
 
192 192
     /**
Please login to merge, or discard this patch.