Passed
Push — master ( 32db04...fadd64 )
by Vasyl
02:53
created
src/VariableManager.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -37,8 +37,8 @@  discard block
 block discarded – undo
37 37
      */
38 38
     public function __construct($variableModel, $cacheRepository, $app = null)
39 39
     {
40
-        if (! $app) {
41
-            $app = app();   //Fallback when $app is not given
40
+        if (!$app) {
41
+            $app = app(); //Fallback when $app is not given
42 42
         }
43 43
         $this->app = $app;
44 44
 
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
                 return $this->cacheRepository->remember(
160 160
                     $this->config['cache']['name'],
161 161
                     $this->config['cache']['time'],
162
-                    function () {
162
+                    function() {
163 163
                         return $this->getVariableModel()->all();
164 164
                     });  
165 165
             } else {
Please login to merge, or discard this patch.
src/VariableServiceProvider.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -19,22 +19,22 @@
 block discarded – undo
19 19
         ], 'config');
20 20
 
21 21
         if (! class_exists('CreateVariablesTable')) {
22
-             $timestamp = date('Y_m_d_His', time());
22
+                $timestamp = date('Y_m_d_His', time());
23 23
 
24
-             $this->publishes([
25
-                 __DIR__.'/../database/migrations/create_variables_table.php.stub' => $this->app->databasePath()."/migrations/{$timestamp}_create_variables_table.php",
26
-             ], 'migrations');
24
+                $this->publishes([
25
+                    __DIR__.'/../database/migrations/create_variables_table.php.stub' => $this->app->databasePath()."/migrations/{$timestamp}_create_variables_table.php",
26
+                ], 'migrations');
27 27
         }
28 28
 
29 29
         $this->replaceConfigsWithVariables();
30 30
 
31 31
         if ($this->app->runningInConsole()) {
32
-             $this->commands([
33
-                 Commands\AllVariable::class,
34
-                 Commands\GetVariable::class,
35
-                 Commands\SaveVariable::class,
36
-                 Commands\CacheClearVariable::class,
37
-             ]);
32
+                $this->commands([
33
+                    Commands\AllVariable::class,
34
+                    Commands\GetVariable::class,
35
+                    Commands\SaveVariable::class,
36
+                    Commands\CacheClearVariable::class,
37
+                ]);
38 38
         }
39 39
     }
40 40
 
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
             __DIR__.'/../config/variables.php' => config_path('variables.php'),
19 19
         ], 'config');
20 20
 
21
-        if (! class_exists('CreateVariablesTable')) {
21
+        if (!class_exists('CreateVariablesTable')) {
22 22
              $timestamp = date('Y_m_d_His', time());
23 23
 
24 24
              $this->publishes([
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
     {
48 48
         $this->mergeConfigFrom(__DIR__.'/../config/variables.php', 'variables');
49 49
 
50
-        $this->app->singleton(VariableManagerContract::class, function () {
50
+        $this->app->singleton(VariableManagerContract::class, function() {
51 51
             $cacheRepo = $this->app->make(\Illuminate\Cache\Repository::class);
52 52
             $variableModel = $this->app['config']->get('variables.model_name');
53 53
             
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 
58 58
     protected function replaceConfigsWithVariables()
59 59
     {
60
-        $this->app->booted(function () {
60
+        $this->app->booted(function() {
61 61
 
62 62
             // Package config
63 63
             $config = $this->app['config']->get('variables');
@@ -69,11 +69,11 @@  discard block
 block discarded – undo
69 69
                 $variables = $this->app->make(VariableManagerContract::class)->all();
70 70
 
71 71
                 foreach ($variables as $var) {
72
-                    if (! empty($variableConfig[$var->key])) {
72
+                    if (!empty($variableConfig[$var->key])) {
73 73
                         $this->app['config']->set($variableConfig[$var->key], $var->value);
74 74
                     }
75
-                    if (! empty($config['config_key_for_vars'])) {
76
-                        $this->app['config']->set($config['config_key_for_vars'] . '.' . $var->key, $var->value);
75
+                    if (!empty($config['config_key_for_vars'])) {
76
+                        $this->app['config']->set($config['config_key_for_vars'].'.'.$var->key, $var->value);
77 77
                     }
78 78
                 }
79 79
             } catch (\Exception $exception) {
Please login to merge, or discard this patch.
src/Commands/GetVariable.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,6 +23,6 @@
 block discarded – undo
23 23
 //            ->setIsUseCache($this->option('cache'))
24 24
             ->get($this->argument('key'), null, $this->option('langcode'), $useCache);
25 25
 
26
-        print_r($variable . "\n");
26
+        print_r($variable."\n");
27 27
     }
28 28
 }
Please login to merge, or discard this patch.
src/Models/Variable.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
     public function byLangcode($query, ?string $langcode = null)
32 32
     {
33 33
         return $query->when($langcode, function ($q) use ($langcode) {
34
-           $q->where('langcode', $langcode);
34
+            $q->where('langcode', $langcode);
35 35
         });
36 36
     }
37 37
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 
22 22
     protected static function booted()
23 23
     {
24
-        static::saved(function ($model) {
24
+        static::saved(function($model) {
25 25
             if (config('variables.cache.autoclear')) {
26 26
                 app(\Fomvasss\Variable\VariableManagerContract::class)->cacheClear();
27 27
             }
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 
31 31
     public function byLangcode($query, ?string $langcode = null)
32 32
     {
33
-        return $query->when($langcode, function ($q) use ($langcode) {
33
+        return $query->when($langcode, function($q) use ($langcode) {
34 34
            $q->where('langcode', $langcode);
35 35
         });
36 36
     }
Please login to merge, or discard this patch.