Completed
Pull Request — master (#1842)
by
unknown
25:37 queued 15:34
created
src/Commands/Publish/PublishMigrationCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
     {
27 27
         $module = $this->getModuleModel($name);
28 28
 
29
-        $this->components->task("Publishing Migration <fg=cyan;options=bold>{$module->getName()}</> Module", function () use ($module) {
29
+        $this->components->task("Publishing Migration <fg=cyan;options=bold>{$module->getName()}</> Module", function() use ($module) {
30 30
             with(new MigrationPublisher(new Migrator($module, $this->getLaravel())))
31 31
                 ->setRepository($this->laravel['modules'])
32 32
                 ->setConsole($this)
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
         });
35 35
     }
36 36
 
37
-    public function getInfo(): string|null
37
+    public function getInfo(): string | null
38 38
     {
39 39
         return 'Publishing module migrations ...';
40 40
     }
Please login to merge, or discard this patch.
src/Commands/Publish/PublishTranslationCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
     {
25 25
         $module = $this->getModuleModel($name);
26 26
 
27
-        $this->components->task("Publishing Translations <fg=cyan;options=bold>{$module->getName()}</> Module", function () use ($module) {
27
+        $this->components->task("Publishing Translations <fg=cyan;options=bold>{$module->getName()}</> Module", function() use ($module) {
28 28
             with(new LangPublisher($module))
29 29
                 ->setRepository($this->laravel['modules'])
30 30
                 ->setConsole($this)
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
         });
33 33
     }
34 34
 
35
-    public function getInfo(): string|null
35
+    public function getInfo(): string | null
36 36
     {
37 37
         return 'Publishing module translations ...';
38 38
     }
Please login to merge, or discard this patch.
src/Commands/Publish/PublishCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
     {
25 25
         $module = $this->getModuleModel($name);
26 26
 
27
-        $this->components->task("Publishing Assets <fg=cyan;options=bold>{$module->getName()}</> Module", function () use ($module) {
27
+        $this->components->task("Publishing Assets <fg=cyan;options=bold>{$module->getName()}</> Module", function() use ($module) {
28 28
             with(new AssetPublisher($module))
29 29
                 ->setRepository($this->laravel['modules'])
30 30
                 ->setConsole($this)
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 
34 34
     }
35 35
 
36
-    public function getInfo(): string|null
36
+    public function getInfo(): string | null
37 37
     {
38 38
         return 'Publishing module asset files ...';
39 39
     }
Please login to merge, or discard this patch.
src/Commands/Make/ViewMakeCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
         $path = $this->laravel['modules']->getModulePath($this->getModuleName());
36 36
         $factoryPath = GenerateConfigReader::read('views');
37 37
 
38
-        return $path . $factoryPath->getPath() . '/' . $this->getFileName();
38
+        return $path.$factoryPath->getPath().'/'.$this->getFileName();
39 39
     }
40 40
 
41 41
     /**
@@ -43,6 +43,6 @@  discard block
 block discarded – undo
43 43
      */
44 44
     private function getFileName(): string
45 45
     {
46
-        return Str::lower($this->argument('name')) . '.blade.php';
46
+        return Str::lower($this->argument('name')).'.blade.php';
47 47
     }
48 48
 }
Please login to merge, or discard this patch.
src/Generators/ModuleGenerator.php 1 patch
Spacing   +15 added lines, -15 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()) . '/' . $folder->getPath();
362
+            $path = $this->module->getModulePath($this->getName()).'/'.$folder->getPath();
363 363
 
364 364
             $this->filesystem->ensureDirectoryExists($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 . '/.gitkeep', '');
378
+        $this->filesystem->put($path.'/.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
                 }
@@ -412,14 +412,14 @@  discard block
 block discarded – undo
412 412
         $providerGenerator = GenerateConfigReader::read('provider');
413 413
         if ($providerGenerator->generate() === true) {
414 414
             $this->console->call('module:make-provider', [
415
-                'name' => $this->getName() . 'ServiceProvider',
415
+                'name' => $this->getName().'ServiceProvider',
416 416
                 'module' => $this->getName(),
417 417
                 '--master' => true,
418 418
             ]);
419 419
         } else {
420 420
             // delete register ServiceProvider on module.json
421
-            $path           = $this->module->getModulePath($this->getName()) . DIRECTORY_SEPARATOR . 'module.json';
422
-            $module_file  =   $this->filesystem->get($path);
421
+            $path = $this->module->getModulePath($this->getName()).DIRECTORY_SEPARATOR.'module.json';
422
+            $module_file = $this->filesystem->get($path);
423 423
             $this->filesystem->put(
424 424
                 $path,
425 425
                 preg_replace('/"providers": \[.*?\],/s', '"providers": [ ],', $module_file)
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
                 $this->filesystem->replaceInFile(
441 441
                     '$this->app->register(Route',
442 442
                     '// $this->app->register(Route',
443
-                    $this->module->getModulePath($this->getName()) . DIRECTORY_SEPARATOR . $providerGenerator->getPath() . DIRECTORY_SEPARATOR . sprintf('%sServiceProvider.php', $this->getName())
443
+                    $this->module->getModulePath($this->getName()).DIRECTORY_SEPARATOR.$providerGenerator->getPath().DIRECTORY_SEPARATOR.sprintf('%sServiceProvider.php', $this->getName())
444 444
                 );
445 445
             }
446 446
         }
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
         if (GenerateConfigReader::read('controller')->generate() === true) {
449 449
             $options = $this->type == 'api' ? ['--api' => true] : [];
450 450
             $this->console->call('module:make-controller', [
451
-                'controller' => $this->getName() . 'Controller',
451
+                'controller' => $this->getName().'Controller',
452 452
                 'module' => $this->getName(),
453 453
             ] + $options);
454 454
         }
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
     protected function getStubContents($stub)
465 465
     {
466 466
         return (new Stub(
467
-            '/' . $stub . '.stub',
467
+            '/'.$stub.'.stub',
468 468
             $this->getReplacement($stub)
469 469
         )
470 470
         )->render();
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
             }
504 504
         }
505 505
         foreach ($keys as $key) {
506
-            if (method_exists($this, $method = 'get' . ucfirst(Str::studly(strtolower($key))) . 'Replacement')) {
506
+            if (method_exists($this, $method = 'get'.ucfirst(Str::studly(strtolower($key))).'Replacement')) {
507 507
                 $replaces[$key] = $this->$method();
508 508
             } else {
509 509
                 $replaces[$key] = null;
@@ -518,9 +518,9 @@  discard block
 block discarded – undo
518 518
      */
519 519
     private function generateModuleJsonFile()
520 520
     {
521
-        $path = $this->module->getModulePath($this->getName()) . 'module.json';
521
+        $path = $this->module->getModulePath($this->getName()).'module.json';
522 522
 
523
-        $this->component->task("Generating file $path", function () use ($path) {
523
+        $this->component->task("Generating file $path", function() use ($path) {
524 524
             if (!$this->filesystem->isDirectory($dir = dirname($path))) {
525 525
                 $this->filesystem->makeDirectory($dir, 0775, true);
526 526
             }
@@ -535,13 +535,13 @@  discard block
 block discarded – undo
535 535
      */
536 536
     private function cleanModuleJsonFile()
537 537
     {
538
-        $path = $this->module->getModulePath($this->getName()) . 'module.json';
538
+        $path = $this->module->getModulePath($this->getName()).'module.json';
539 539
 
540 540
         $content = $this->filesystem->get($path);
541 541
         $namespace = $this->getModuleNamespaceReplacement();
542 542
         $studlyName = $this->getStudlyNameReplacement();
543 543
 
544
-        $provider = '"' . $namespace . '\\\\' . $studlyName . '\\\\Providers\\\\' . $studlyName . 'ServiceProvider"';
544
+        $provider = '"'.$namespace.'\\\\'.$studlyName.'\\\\Providers\\\\'.$studlyName.'ServiceProvider"';
545 545
 
546 546
         $content = str_replace($provider, '', $content);
547 547
 
Please login to merge, or discard this patch.
src/Commands/Make/GeneratorCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
         $contents = $this->getTemplateContents();
47 47
 
48 48
         try {
49
-            $this->components->task("Generating file {$path}", function () use ($path, $contents) {
49
+            $this->components->task("Generating file {$path}", function() use ($path, $contents) {
50 50
                 $overwriteFile = $this->hasOption('force') ? $this->option('force') : false;
51 51
                 (new FileGenerator($path, $contents))->withFileOverwrite($overwriteFile)->generate();
52 52
             });
@@ -91,6 +91,6 @@  discard block
 block discarded – undo
91 91
     {
92 92
         $path_namespace = $this->path_namespace(str_replace($this->getClass(), '', $this->argument($this->argumentName)));
93 93
 
94
-        return $this->module_namespace($module->getStudlyName(), $this->getDefaultNamespace() . ($path_namespace ? '\\' . $path_namespace : ''));
94
+        return $this->module_namespace($module->getStudlyName(), $this->getDefaultNamespace().($path_namespace ? '\\'.$path_namespace : ''));
95 95
     }
96 96
 }
Please login to merge, or discard this patch.
src/Traits/PathNamespace.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,8 +38,8 @@
 block discarded – undo
38 38
      */
39 39
     public function module_namespace(string $module, string $path = null): string
40 40
     {
41
-        $module_namespace = config('modules.namespace', $this->path_namespace(config('modules.paths.modules'))) . '\\' . ($module);
42
-        $module_namespace .= strlen($path) ? '\\' . $this->path_namespace($path) : '';
41
+        $module_namespace = config('modules.namespace', $this->path_namespace(config('modules.paths.modules'))).'\\'.($module);
42
+        $module_namespace .= strlen($path) ? '\\'.$this->path_namespace($path) : '';
43 43
 
44 44
         return $this->studly_namespace($module_namespace);
45 45
     }
Please login to merge, or discard this patch.
src/Commands/Make/EnumMakeCommand.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,9 +21,9 @@  discard block
 block discarded – undo
21 21
     {
22 22
         $path = $this->laravel['modules']->getModulePath($this->getModuleName());
23 23
 
24
-        $filePath = GenerateConfigReader::read('enums')->getPath() ?? config('modules.paths.app_folder') . 'Enums';
24
+        $filePath = GenerateConfigReader::read('enums')->getPath() ?? config('modules.paths.app_folder').'Enums';
25 25
 
26
-        return $path . $filePath . '/' . $this->getEnumName() . '.php';
26
+        return $path.$filePath.'/'.$this->getEnumName().'.php';
27 27
     }
28 28
 
29 29
     protected function getTemplateContents(): string
@@ -54,12 +54,12 @@  discard block
 block discarded – undo
54 54
         ];
55 55
     }
56 56
 
57
-    protected function getEnumName(): array|string
57
+    protected function getEnumName(): array | string
58 58
     {
59 59
         return Str::studly($this->argument('name'));
60 60
     }
61 61
 
62
-    private function getClassNameWithoutNamespace(): array|string
62
+    private function getClassNameWithoutNamespace(): array | string
63 63
     {
64 64
         return class_basename($this->getEnumName());
65 65
     }
Please login to merge, or discard this patch.
src/Commands/Make/ServiceMakeCommand.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,9 +21,9 @@  discard block
 block discarded – undo
21 21
     {
22 22
         $path = $this->laravel['modules']->getModulePath($this->getModuleName());
23 23
 
24
-        $filePath = GenerateConfigReader::read('services')->getPath() ?? config('modules.paths.app_folder') . 'Services';
24
+        $filePath = GenerateConfigReader::read('services')->getPath() ?? config('modules.paths.app_folder').'Services';
25 25
 
26
-        return $path . $filePath . '/' . $this->getServiceName() . '.php';
26
+        return $path.$filePath.'/'.$this->getServiceName().'.php';
27 27
     }
28 28
 
29 29
     protected function getTemplateContents(): string
@@ -55,12 +55,12 @@  discard block
 block discarded – undo
55 55
         ];
56 56
     }
57 57
 
58
-    protected function getServiceName(): array|string
58
+    protected function getServiceName(): array | string
59 59
     {
60 60
         return Str::studly($this->argument('name'));
61 61
     }
62 62
 
63
-    private function getClassNameWithoutNamespace(): array|string
63
+    private function getClassNameWithoutNamespace(): array | string
64 64
     {
65 65
         return class_basename($this->getServiceName());
66 66
     }
Please login to merge, or discard this patch.