Passed
Pull Request — master (#2)
by lee
04:08
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   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
                 $value = str_replace('ç€π', '\\', $value);
159 159
                 $value = str_replace('@ƻ', '/', $value);
160 160
             case 'string':
161
-                $value =  trim($value, '"');
161
+                $value = trim($value, '"');
162 162
             default:
163 163
                 return (string) $value;
164 164
         }
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
 
239 239
         if ($setting->type === 'boolean' && is_string($value)) {
240 240
             $value = ($value === 'false') ? false : $value;
241
-            $value = ($value === 'true')  ? true  : $value;
241
+            $value = ($value === 'true') ? true  : $value;
242 242
         }
243 243
         if ($setting->type === 'integer' && is_string($value) && ctype_digit($value)) {
244 244
             $value = (int) $value;
@@ -276,8 +276,8 @@  discard block
 block discarded – undo
276 276
      */
277 277
     public static function allSettings() : array
278 278
     {
279
-        if (! static::$all_settings) {
280
-            static::$all_settings = Cache::rememberForever('settings.all', function () {
279
+        if (!static::$all_settings) {
280
+            static::$all_settings = Cache::rememberForever('settings.all', function() {
281 281
                 return self::all()->keyBy('key')->toArray();
282 282
             });
283 283
         }
@@ -309,14 +309,14 @@  discard block
 block discarded – undo
309 309
     public static function getValidationRules() : array
310 310
     {
311 311
         if ('mysql' === \DB::connection()->getPDO()->getAttribute(\PDO::ATTR_DRIVER_NAME)) {
312
-            return Cache::rememberForever('settings.rules', function () {
312
+            return Cache::rememberForever('settings.rules', function() {
313 313
                 return Setting::select(\DB::raw('concat_ws("|", rules, type) as rules, `key`'))
314 314
                             ->pluck('rules', 'key')
315 315
                             ->toArray();
316 316
             });
317 317
         }
318 318
 
319
-        return Cache::rememberForever('settings.rules', function () {
319
+        return Cache::rememberForever('settings.rules', function() {
320 320
             return Setting::select(\DB::raw("printf('%s|%s', rules, type) as rules, `key`"))
321 321
                             ->pluck('rules', 'key')
322 322
                             ->toArray();
@@ -341,15 +341,15 @@  discard block
 block discarded – undo
341 341
     {
342 342
         parent::boot();
343 343
 
344
-        static::deleted(function () {
344
+        static::deleted(function() {
345 345
             self::flushCache();
346 346
             static::$all_settings = [];
347 347
         });
348
-        static::updated(function () {
348
+        static::updated(function() {
349 349
             self::flushCache();
350 350
             static::$all_settings = [];
351 351
         });
352
-        static::created(function () {
352
+        static::created(function() {
353 353
             self::flushCache();
354 354
             static::$all_settings = [];
355 355
         });
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.