Completed
Pull Request — master (#1513)
by
unknown
06:41
created
src/Providers/BootstrapServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
             $this->registerMigrations();
19 19
 
20 20
             $this->publishes([
21
-                __DIR__ . '/../../database/migrations' => database_path('migrations'),
21
+                __DIR__.'/../../database/migrations' => database_path('migrations'),
22 22
             ], 'module-migrations');
23 23
         }
24 24
     }
@@ -33,6 +33,6 @@  discard block
 block discarded – undo
33 33
 
34 34
     private function registerMigrations()
35 35
     {
36
-        $this->loadMigrationsFrom(__DIR__ . '/../../database/migrations');
36
+        $this->loadMigrationsFrom(__DIR__.'/../../database/migrations');
37 37
     }
38 38
 }
Please login to merge, or discard this patch.
database/migrations/2020_12_29_025357_create_modules_table.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
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create('modules', function (Blueprint $table) {
16
+        Schema::create('modules', function(Blueprint $table) {
17 17
             $table->increments('id');
18 18
             $table->string('name');
19 19
             $table->string('path');
Please login to merge, or discard this patch.
src/Generators/DatabaseModuleGenerator.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      */
29 29
     public function generate(): int
30 30
     {
31
-        return DB::transaction(function () {
31
+        return DB::transaction(function() {
32 32
             $name = $this->getName();
33 33
 
34 34
             if ($this->module->has($name)) {
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     public function generateFiles()
83 83
     {
84 84
         foreach ($this->getFiles() as $stub => $file) {
85
-            $path = $this->module->getModulePath($this->getName()) . $file;
85
+            $path = $this->module->getModulePath($this->getName()).$file;
86 86
 
87 87
             if (!$this->filesystem->isDirectory($dir = dirname($path))) {
88 88
                 $this->filesystem->makeDirectory($dir, 0775, true);
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 
114 114
         if (GenerateConfigReader::read('provider')->generate() === true) {
115 115
             Artisan::call('module:make-provider', [
116
-                'name'     => $moduleName . 'ServiceProvider',
116
+                'name'     => $moduleName.'ServiceProvider',
117 117
                 'module'   => $moduleName,
118 118
                 '--master' => true,
119 119
             ]);
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
         if (GenerateConfigReader::read('controller')->generate() === true) {
126 126
             $options = $this->type == 'api' ? ['--api' => true] : [];
127 127
             Artisan::call('module:make-controller', [
128
-                    'controller' => $moduleName . 'Controller',
128
+                    'controller' => $moduleName.'Controller',
129 129
                     'module'     => $moduleName,
130 130
                 ] + $options);
131 131
         }
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
      */
137 137
     private function generateModuleJsonFile()
138 138
     {
139
-        $path = $this->module->getModulePath($this->getName()) . 'module.json';
139
+        $path = $this->module->getModulePath($this->getName()).'module.json';
140 140
 
141 141
         if (!$this->filesystem->isDirectory($dir = dirname($path))) {
142 142
             $this->filesystem->makeDirectory($dir, 0775, true);
Please login to merge, or discard this patch.
src/Generators/ModuleGenerator.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
                 continue;
360 360
             }
361 361
 
362
-            $path = $this->module->getModulePath($this->getName()) . DIRECTORY_SEPARATOR . $folder->getPath();
362
+            $path = $this->module->getModulePath($this->getName()).DIRECTORY_SEPARATOR.$folder->getPath();
363 363
 
364 364
             $this->filesystem->makeDirectory($path, 0755, true);
365 365
             if (config('modules.stubs.gitkeep')) {
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
      */
376 376
     public function generateGitKeep($path)
377 377
     {
378
-        $this->filesystem->put($path . DIRECTORY_SEPARATOR . '.gitkeep', '');
378
+        $this->filesystem->put($path.DIRECTORY_SEPARATOR.'.gitkeep', '');
379 379
     }
380 380
 
381 381
     /**
@@ -384,9 +384,9 @@  discard block
 block discarded – undo
384 384
     public function generateFiles()
385 385
     {
386 386
         foreach ($this->getFiles() as $stub => $file) {
387
-            $path = $this->module->getModulePath($this->getName()) . $file;
387
+            $path = $this->module->getModulePath($this->getName()).$file;
388 388
 
389
-            $this->component->task("Generating file {$path}",function () use ($stub, $path) {
389
+            $this->component->task("Generating file {$path}", function() use ($stub, $path) {
390 390
                 if (!$this->filesystem->isDirectory($dir = dirname($path))) {
391 391
                     $this->filesystem->makeDirectory($dir, 0775, true);
392 392
                 }
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
 
412 412
         if (GenerateConfigReader::read('provider')->generate() === true) {
413 413
             $this->console->call('module:make-provider', [
414
-                'name' => $this->getName() . 'ServiceProvider',
414
+                'name' => $this->getName().'ServiceProvider',
415 415
                 'module' => $this->getName(),
416 416
                 '--master' => true,
417 417
             ]);
@@ -421,11 +421,11 @@  discard block
 block discarded – undo
421 421
         }
422 422
 
423 423
         if (GenerateConfigReader::read('controller')->generate() === true) {
424
-            $options = $this->type=='api' ? ['--api'=>true] : [];
424
+            $options = $this->type == 'api' ? ['--api'=>true] : [];
425 425
             $this->console->call('module:make-controller', [
426
-                'controller' => $this->getName() . 'Controller',
426
+                'controller' => $this->getName().'Controller',
427 427
                 'module' => $this->getName(),
428
-            ]+$options);
428
+            ] + $options);
429 429
         }
430 430
     }
431 431
 
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
     protected function getStubContents($stub)
440 440
     {
441 441
         return (new Stub(
442
-            DIRECTORY_SEPARATOR . $stub . '.stub',
442
+            DIRECTORY_SEPARATOR.$stub.'.stub',
443 443
             $this->getReplacement($stub)
444 444
         )
445 445
         )->render();
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
             }
479 479
         }
480 480
         foreach ($keys as $key) {
481
-            if (method_exists($this, $method = 'get' . ucfirst(Str::studly(strtolower($key))) . 'Replacement')) {
481
+            if (method_exists($this, $method = 'get'.ucfirst(Str::studly(strtolower($key))).'Replacement')) {
482 482
                 $replaces[$key] = $this->$method();
483 483
             } else {
484 484
                 $replaces[$key] = null;
@@ -493,9 +493,9 @@  discard block
 block discarded – undo
493 493
      */
494 494
     private function generateModuleJsonFile()
495 495
     {
496
-        $path = $this->module->getModulePath($this->getName()) . 'module.json';
496
+        $path = $this->module->getModulePath($this->getName()).'module.json';
497 497
 
498
-        $this->component->task("Generating file $path",function () use ($path) {
498
+        $this->component->task("Generating file $path", function() use ($path) {
499 499
             if (!$this->filesystem->isDirectory($dir = dirname($path))) {
500 500
                 $this->filesystem->makeDirectory($dir, 0775, true);
501 501
             }
@@ -510,13 +510,13 @@  discard block
 block discarded – undo
510 510
      */
511 511
     private function cleanModuleJsonFile()
512 512
     {
513
-        $path = $this->module->getModulePath($this->getName()) . 'module.json';
513
+        $path = $this->module->getModulePath($this->getName()).'module.json';
514 514
 
515 515
         $content = $this->filesystem->get($path);
516 516
         $namespace = $this->getModuleNamespaceReplacement();
517 517
         $studlyName = $this->getStudlyNameReplacement();
518 518
 
519
-        $provider = '"' . $namespace . '\\\\' . $studlyName . '\\\\Providers\\\\' . $studlyName . 'ServiceProvider"';
519
+        $provider = '"'.$namespace.'\\\\'.$studlyName.'\\\\Providers\\\\'.$studlyName.'ServiceProvider"';
520 520
 
521 521
         $content = str_replace($provider, '', $content);
522 522
 
Please login to merge, or discard this patch.
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/Laravel/LaravelDatabaseRepository.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -88,10 +88,10 @@  discard block
 block discarded – undo
88 88
         $module = $this->find($name);
89 89
 
90 90
         if ($module) {
91
-            return $module->getPath() . DIRECTORY_SEPARATOR;
91
+            return $module->getPath().DIRECTORY_SEPARATOR;
92 92
         }
93 93
 
94
-        return $this->getPath() . DIRECTORY_SEPARATOR . Str::studly($name) . DIRECTORY_SEPARATOR;
94
+        return $this->getPath().DIRECTORY_SEPARATOR.Str::studly($name).DIRECTORY_SEPARATOR;
95 95
     }
96 96
 
97 97
     /**
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
      */
142 142
     public function getCached()
143 143
     {
144
-        return $this->app['cache']->remember($this->config('cache.key'), $this->config('cache.lifetime'), function () {
144
+        return $this->app['cache']->remember($this->config('cache.key'), $this->config('cache.lifetime'), function() {
145 145
             return $this->getModel()->all();
146 146
         });
147 147
     }
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
         $modules = [];
219 219
 
220 220
         foreach ($paths as $key => $path) {
221
-            $manifests = $this->getFiles()->glob($path . DIRECTORY_SEPARATOR . 'module.json');
221
+            $manifests = $this->getFiles()->glob($path.DIRECTORY_SEPARATOR.'module.json');
222 222
 
223 223
             is_array($manifests) || $manifests = [];
224 224
 
@@ -253,10 +253,10 @@  discard block
 block discarded – undo
253 253
 
254 254
     public function update($name)
255 255
     {
256
-        $module =  $this->findOrFail($name);
256
+        $module = $this->findOrFail($name);
257 257
         $updater = new Updater($this);
258 258
         if ($this->config('database_management.update_file_to_database_when_updating')) {
259
-            $json = Json::make($module->getPath() . DIRECTORY_SEPARATOR . 'module.json');
259
+            $json = Json::make($module->getPath().DIRECTORY_SEPARATOR.'module.json');
260 260
             $data = $json->getAttributes();
261 261
 
262 262
             if (!isset($data['version'])) {
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
             $allows = $this->getModel()->getFillable();
289 289
         }
290 290
 
291
-        return array_filter($attributes, function ($k) use ($allows) {
291
+        return array_filter($attributes, function($k) use ($allows) {
292 292
             return in_array($k, $allows);
293 293
         }, ARRAY_FILTER_USE_KEY);
294 294
     }
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
     {
298 298
         $modules = $this->allEnabled();
299 299
 
300
-        uasort($modules, function (DatabaseModule $a, DatabaseModule $b) use ($direction) {
300
+        uasort($modules, function(DatabaseModule $a, DatabaseModule $b) use ($direction) {
301 301
             if ($a->get('priority') === $b->get('priority')) {
302 302
                 return 0;
303 303
             }
Please login to merge, or discard this patch.