Completed
Pull Request — master (#1905)
by Solomon
08:15
created
src/helpers.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
     use PathNamespace;
10 10
 }
11 11
 
12
-if (! function_exists('module_path')) {
12
+if (!function_exists('module_path')) {
13 13
     function module_path(string $name, ?string $path = null)
14 14
     {
15 15
         $helper = new Helper();
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
     }
20 20
 }
21 21
 
22
-if (! function_exists('module_app_path')) {
22
+if (!function_exists('module_app_path')) {
23 23
     function module_app_path(string $name, ?string $path = null)
24 24
     {
25 25
         $helper = new Helper();
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
     }
30 30
 }
31 31
 
32
-if (! function_exists('config_path')) {
32
+if (!function_exists('config_path')) {
33 33
     /**
34 34
      * Get the configuration path.
35 35
      *
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     }
43 43
 }
44 44
 
45
-if (! function_exists('public_path')) {
45
+if (!function_exists('public_path')) {
46 46
     /**
47 47
      * Get the path to the public folder.
48 48
      *
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
     }
56 56
 }
57 57
 
58
-if (! function_exists('module_vite')) {
58
+if (!function_exists('module_vite')) {
59 59
     /**
60 60
      * support for vite
61 61
      */
Please login to merge, or discard this patch.
src/Generators/ModuleGenerator.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
                 continue;
387 387
             }
388 388
 
389
-            $path = $this->module->getModulePath($this->getName()) . '/' . $folder->getPath();
389
+            $path = $this->module->getModulePath($this->getName()).'/'.$folder->getPath();
390 390
 
391 391
             $this->filesystem->ensureDirectoryExists($path, 0755, true);
392 392
             if (config('modules.stubs.gitkeep')) {
@@ -402,7 +402,7 @@  discard block
 block discarded – undo
402 402
      */
403 403
     public function generateGitKeep($path)
404 404
     {
405
-        $this->filesystem->put($path . '/.gitkeep', '');
405
+        $this->filesystem->put($path.'/.gitkeep', '');
406 406
     }
407 407
 
408 408
     /**
@@ -411,9 +411,9 @@  discard block
 block discarded – undo
411 411
     public function generateFiles()
412 412
     {
413 413
         foreach ($this->getFiles() as $stub => $file) {
414
-            $path = $this->module->getModulePath($this->getName()) . $file;
414
+            $path = $this->module->getModulePath($this->getName()).$file;
415 415
 
416
-            $this->component->task("Generating file {$path}", function () use ($stub, $path) {
416
+            $this->component->task("Generating file {$path}", function() use ($stub, $path) {
417 417
                 if (!$this->filesystem->isDirectory($dir = dirname($path))) {
418 418
                     $this->filesystem->makeDirectory($dir, 0775, true);
419 419
                 }
@@ -439,13 +439,13 @@  discard block
 block discarded – undo
439 439
         $providerGenerator = GenerateConfigReader::read('provider');
440 440
         if ($providerGenerator->generate() === true) {
441 441
             $this->console->call('module:make-provider', [
442
-                'name' => $this->getName() . 'ServiceProvider',
442
+                'name' => $this->getName().'ServiceProvider',
443 443
                 'module' => $this->getName(),
444 444
                 '--master' => true,
445 445
             ]);
446 446
         } else {
447 447
             // delete register ServiceProvider on module.json
448
-            $path = $this->module->getModulePath($this->getName()) . DIRECTORY_SEPARATOR . 'module.json';
448
+            $path = $this->module->getModulePath($this->getName()).DIRECTORY_SEPARATOR.'module.json';
449 449
             $module_file = $this->filesystem->get($path);
450 450
             $this->filesystem->put(
451 451
                 $path,
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
                 $this->filesystem->replaceInFile(
468 468
                     '$this->app->register(Event',
469 469
                     '// $this->app->register(Event',
470
-                    $this->module->getModulePath($this->getName()) . DIRECTORY_SEPARATOR . $providerGenerator->getPath() . DIRECTORY_SEPARATOR . sprintf('%sServiceProvider.php', $this->getName())
470
+                    $this->module->getModulePath($this->getName()).DIRECTORY_SEPARATOR.$providerGenerator->getPath().DIRECTORY_SEPARATOR.sprintf('%sServiceProvider.php', $this->getName())
471 471
                 );
472 472
             }
473 473
         }
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
                 $this->filesystem->replaceInFile(
487 487
                     '$this->app->register(Route',
488 488
                     '// $this->app->register(Route',
489
-                    $this->module->getModulePath($this->getName()) . DIRECTORY_SEPARATOR . $providerGenerator->getPath() . DIRECTORY_SEPARATOR . sprintf('%sServiceProvider.php', $this->getName())
489
+                    $this->module->getModulePath($this->getName()).DIRECTORY_SEPARATOR.$providerGenerator->getPath().DIRECTORY_SEPARATOR.sprintf('%sServiceProvider.php', $this->getName())
490 490
                 );
491 491
             }
492 492
         }
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
         if (GenerateConfigReader::read('controller')->generate() === true) {
495 495
             $options = $this->type == 'api' ? ['--api' => true] : [];
496 496
             $this->console->call('module:make-controller', [
497
-                'controller' => $this->getName() . 'Controller',
497
+                'controller' => $this->getName().'Controller',
498 498
                 'module' => $this->getName(),
499 499
             ] + $options);
500 500
         }
@@ -509,7 +509,7 @@  discard block
 block discarded – undo
509 509
     protected function getStubContents($stub)
510 510
     {
511 511
         return (new Stub(
512
-            '/' . $stub . '.stub',
512
+            '/'.$stub.'.stub',
513 513
             $this->getReplacement($stub)
514 514
         )
515 515
         )->render();
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
         }
550 550
 
551 551
         foreach ($keys as $key) {
552
-            $method = 'get' . Str::of($key)->lower()->studly() . 'Replacement';
552
+            $method = 'get'.Str::of($key)->lower()->studly().'Replacement';
553 553
             if (method_exists($this, $method)) {
554 554
                 $replaces[$key] = $this->$method();
555 555
             } else {
@@ -637,7 +637,7 @@  discard block
 block discarded – undo
637 637
      */
638 638
     protected function getAppNamespaceReplacement(): string
639 639
     {
640
-        return $this->path_namespace($this->app_path()) . '\\\\';
640
+        return $this->path_namespace($this->app_path()).'\\\\';
641 641
     }
642 642
 
643 643
     /**
Please login to merge, or discard this patch.