Completed
Pull Request — master (#1513)
by
unknown
07:11
created
src/Module.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
     {
184 184
         $lowerName = $this->getLowerName();
185 185
 
186
-        $langPath = $this->getPath() . '/Resources/lang';
186
+        $langPath = $this->getPath().'/Resources/lang';
187 187
 
188 188
         if (is_dir($langPath)) {
189 189
             $this->loadTranslationsFrom($langPath, $lowerName);
@@ -203,8 +203,8 @@  discard block
 block discarded – undo
203 203
             $file = 'module.json';
204 204
         }
205 205
 
206
-        return Arr::get($this->moduleJson, $file, function () use ($file) {
207
-            return $this->moduleJson[$file] = new Json($this->getPath() . DIRECTORY_SEPARATOR . $file, $this->files);
206
+        return Arr::get($this->moduleJson, $file, function() use ($file) {
207
+            return $this->moduleJson[$file] = new Json($this->getPath().DIRECTORY_SEPARATOR.$file, $this->files);
208 208
         });
209 209
     }
210 210
 
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
      */
258 258
     protected function fireEvent($event): void
259 259
     {
260
-        $this->app['events']->dispatch(sprintf('modules.%s.' . $event, $this->getLowerName()), [$this]);
260
+        $this->app['events']->dispatch(sprintf('modules.%s.'.$event, $this->getLowerName()), [$this]);
261 261
     }
262 262
     /**
263 263
      * Register the aliases from this module.
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
     protected function registerFiles(): void
283 283
     {
284 284
         foreach ($this->get('files', []) as $file) {
285
-            include $this->path . DIRECTORY_SEPARATOR . $file;
285
+            include $this->path.DIRECTORY_SEPARATOR.$file;
286 286
         }
287 287
     }
288 288
 
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
      */
388 388
     public function getExtraPath(string $path): string
389 389
     {
390
-        return $this->getPath() . DIRECTORY_SEPARATOR . $path;
390
+        return $this->getPath().DIRECTORY_SEPARATOR.$path;
391 391
     }
392 392
 
393 393
     /**
Please login to merge, or discard this patch.
src/Json.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -120,11 +120,11 @@  discard block
 block discarded – undo
120 120
      */
121 121
     public function decodeContents()
122 122
     {
123
-        $attributes =  json_decode($this->getContents(), 1);
123
+        $attributes = json_decode($this->getContents(), 1);
124 124
 
125 125
         // any JSON parsing errors should throw an exception
126 126
         if (json_last_error() > 0) {
127
-            throw new InvalidJsonException('Error processing file: ' . $this->getPath() . '. Error: ' . json_last_error_msg());
127
+            throw new InvalidJsonException('Error processing file: '.$this->getPath().'. Error: '.json_last_error_msg());
128 128
         }
129 129
 
130 130
         return $attributes;
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
             return $this->decodeContents();
143 143
         }
144 144
 
145
-        return app('cache')->store(config('modules.cache.driver'))->remember($this->getPath(), config('modules.cache.lifetime'), function () {
145
+        return app('cache')->store(config('modules.cache.driver'))->remember($this->getPath(), config('modules.cache.lifetime'), function() {
146 146
             return $this->decodeContents();
147 147
         });
148 148
     }
Please login to merge, or discard this patch.
src/Providers/BootstrapServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
             $this->registerMigrations();
23 23
 
24 24
             $this->publishes([
25
-                __DIR__ . '/../../database/migrations' => database_path('migrations'),
25
+                __DIR__.'/../../database/migrations' => database_path('migrations'),
26 26
             ], 'module-migrations');
27 27
         }
28 28
     }
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 
38 38
     private function registerMigrations()
39 39
     {
40
-        $this->loadMigrationsFrom(__DIR__ . '/../../database/migrations');
40
+        $this->loadMigrationsFrom(__DIR__.'/../../database/migrations');
41 41
     }
42 42
 
43 43
     /**
Please login to merge, or discard this patch.
src/Laravel/LaravelDatabaseRepository.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -89,10 +89,10 @@  discard block
 block discarded – undo
89 89
         $module = $this->find($name);
90 90
 
91 91
         if ($module) {
92
-            return $module->getPath() . DIRECTORY_SEPARATOR;
92
+            return $module->getPath().DIRECTORY_SEPARATOR;
93 93
         }
94 94
 
95
-        return $this->getPath() . DIRECTORY_SEPARATOR . Str::studly($name) . DIRECTORY_SEPARATOR;
95
+        return $this->getPath().DIRECTORY_SEPARATOR.Str::studly($name).DIRECTORY_SEPARATOR;
96 96
     }
97 97
 
98 98
     /**
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
     public function getCached()
151 151
     {
152 152
         return $this->cache->store($this->config->get('modules.cache.driver'))
153
-            ->remember($this->config('cache.key'), $this->config('cache.lifetime'), function () {
153
+            ->remember($this->config('cache.key'), $this->config('cache.lifetime'), function() {
154 154
                 return $this->getModel()->all()->keyBy('name')->toArray();
155 155
             });
156 156
     }
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
         // Support modules that already there or copy/paste and not scan yet.
231 231
         // So we scan all module.json in every folder.
232 232
         foreach ($paths as $path) {
233
-            $manifests = $this->getFiles()->glob($path . DIRECTORY_SEPARATOR . 'module.json');
233
+            $manifests = $this->getFiles()->glob($path.DIRECTORY_SEPARATOR.'module.json');
234 234
 
235 235
             is_array($manifests) || $manifests = [];
236 236
 
@@ -271,10 +271,10 @@  discard block
 block discarded – undo
271 271
 
272 272
     public function update($name)
273 273
     {
274
-        $module =  $this->findOrFail($name);
274
+        $module = $this->findOrFail($name);
275 275
         $updater = new Updater($this);
276 276
         if ($this->config('database_management.update_file_to_database_when_updating')) {
277
-            $json = Json::make($module->getPath() . DIRECTORY_SEPARATOR . 'module.json');
277
+            $json = Json::make($module->getPath().DIRECTORY_SEPARATOR.'module.json');
278 278
             $data = $json->getAttributes();
279 279
 
280 280
             if (!isset($data['version'])) {
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
             $allows = $this->getModel()->getFillable();
308 308
         }
309 309
 
310
-        return array_filter($attributes, function ($k) use ($allows) {
310
+        return array_filter($attributes, function($k) use ($allows) {
311 311
             return in_array($k, $allows);
312 312
         }, ARRAY_FILTER_USE_KEY);
313 313
     }
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
     {
317 317
         $modules = $this->allEnabled();
318 318
 
319
-        uasort($modules, function (DatabaseModule $a, DatabaseModule $b) use ($direction) {
319
+        uasort($modules, function(DatabaseModule $a, DatabaseModule $b) use ($direction) {
320 320
             if ($a->get('priority') === $b->get('priority')) {
321 321
                 return 0;
322 322
             }
Please login to merge, or discard this patch.
src/Commands/DisableCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
         $this->components->info('Disabling module ...');
38 38
         
39 39
         if (count($this->argument('module'))) {
40
-            foreach($this->argument('module') as $name) {
40
+            foreach ($this->argument('module') as $name) {
41 41
                 $this->disable($name);
42 42
             }
43 43
             return 0;
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
     {
74 74
         if ($name instanceof Module) {
75 75
             $module = $name;
76
-        }else {
76
+        } else {
77 77
             $module = $this->laravel['modules']->findOrFail($name);
78 78
         }
79 79
 
Please login to merge, or discard this patch.