Passed
Push — master ( af5ddd...21d5f2 )
by Andreas
03:39
created
src/Setting.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -114,11 +114,11 @@
 block discarded – undo
114 114
     }
115 115
 
116 116
     /**
117
-    * Check if setting exists
118
-    *
119
-    * @param $key
120
-    * @return bool
121
-    */
117
+     * Check if setting exists
118
+     *
119
+     * @param $key
120
+     * @return bool
121
+     */
122 122
     public static function has(string $key) : bool
123 123
     {
124 124
         return (boolean) isset(self::allSettings()[$key]);
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
                 $value = str_replace('ç€π', '\\', $value);
157 157
                 $value = str_replace('@ƻ', '/', $value);
158 158
             case 'string':
159
-                $value =  trim($value, '"');
159
+                $value = trim($value, '"');
160 160
             default:
161 161
                 return (string) $value;
162 162
         }
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 
237 237
         if ($setting->type === 'boolean' && is_string($value)) {
238 238
             $value = ($value === 'false') ? false : $value;
239
-            $value = ($value === 'true')  ? true  : $value;
239
+            $value = ($value === 'true') ? true  : $value;
240 240
         }
241 241
 
242 242
         if ($validate && !$setting->validateNewValue($value)) {
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
      */
272 272
     public static function allSettings() : array
273 273
     {
274
-        return Cache::rememberForever('settings.all', function () {
274
+        return Cache::rememberForever('settings.all', function() {
275 275
             return $settings = self::all()->keyBy('key')->toArray();
276 276
         });
277 277
     }
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
     public static function getValidationRules() : array
300 300
     {
301 301
         if ('mysql' === \DB::connection()->getPDO()->getAttribute(\PDO::ATTR_DRIVER_NAME)) {
302
-            return Cache::rememberForever('settings.rules', function () {
302
+            return Cache::rememberForever('settings.rules', function() {
303 303
                 return Setting::select(\DB::raw('concat_ws("|", rules, type) as rules, `key`'))
304 304
                             ->pluck('rules', 'key')
305 305
                             ->toArray();
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
         }
308 308
 
309 309
 
310
-        return Cache::rememberForever('settings.rules', function () {
310
+        return Cache::rememberForever('settings.rules', function() {
311 311
             return Setting::select(\DB::raw("printf('%s|%s', rules, type) as rules, `key`"))
312 312
                             ->pluck('rules', 'key')
313 313
                             ->toArray();
@@ -332,13 +332,13 @@  discard block
 block discarded – undo
332 332
     {
333 333
         parent::boot();
334 334
 
335
-        static::deleted(function () {
335
+        static::deleted(function() {
336 336
             self::flushCache();
337 337
         });
338
-        static::updated(function () {
338
+        static::updated(function() {
339 339
             self::flushCache();
340 340
         });
341
-        static::created(function () {
341
+        static::created(function() {
342 342
             self::flushCache();
343 343
         });
344 344
     }
Please login to merge, or discard this patch.
src/SettingsServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
         ], 'config');
14 14
 
15 15
         $this->publishes([
16
-                __DIR__ . '/../database/migrations/0000_00_00__create_settings_table.php' => base_path() . '/database/migrations/'. date('Y_m_d_His', time()) . '_create_settings_table.php'
16
+                __DIR__ . '/../database/migrations/0000_00_00__create_settings_table.php' => base_path() . '/database/migrations/' . date('Y_m_d_His', time()) . '_create_settings_table.php'
17 17
         ], 'migrations');
18 18
     }
19 19
 
Please login to merge, or discard this patch.
src/Utils/helpers.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,14 +2,14 @@
 block discarded – undo
2 2
 
3 3
 use \Ottosmops\Settings\Setting;
4 4
 
5
-if (! function_exists('setting')) {
5
+if (!function_exists('setting')) {
6 6
     function setting($key, $default = null)
7 7
     {
8 8
         return Setting::getValue($key, $default);
9 9
     }
10 10
 }
11 11
 
12
-if (! function_exists('settingAsString')) {
12
+if (!function_exists('settingAsString')) {
13 13
     function settingAsString($key, $default = null)
14 14
     {
15 15
         return Setting::getValueAsString($key, $default);
Please login to merge, or discard this patch.