Completed
Pull Request — master (#1764)
by
unknown
07:04
created
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->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 . '/.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
                 }
@@ -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
-            '/' . $stub . '.stub',
442
+            '/'.$stub.'.stub',
443 443
             $this->getReplacement($stub)
444 444
         )
445 445
         )->render();
@@ -480,7 +480,7 @@  discard block
 block discarded – undo
480 480
             }
481 481
         }
482 482
         foreach ($keys as $key) {
483
-            if (method_exists($this, $method = 'get' . ucfirst(Str::studly(strtolower($key))) . 'Replacement')) {
483
+            if (method_exists($this, $method = 'get'.ucfirst(Str::studly(strtolower($key))).'Replacement')) {
484 484
                 $replaces[$key] = $this->$method();
485 485
             } else {
486 486
                 $replaces[$key] = null;
@@ -495,9 +495,9 @@  discard block
 block discarded – undo
495 495
      */
496 496
     private function generateModuleJsonFile()
497 497
     {
498
-        $path = $this->module->getModulePath($this->getName()) . 'module.json';
498
+        $path = $this->module->getModulePath($this->getName()).'module.json';
499 499
 
500
-        $this->component->task("Generating file $path",function () use ($path) {
500
+        $this->component->task("Generating file $path", function() use ($path) {
501 501
             if (!$this->filesystem->isDirectory($dir = dirname($path))) {
502 502
                 $this->filesystem->makeDirectory($dir, 0775, true);
503 503
             }
@@ -512,13 +512,13 @@  discard block
 block discarded – undo
512 512
      */
513 513
     private function cleanModuleJsonFile()
514 514
     {
515
-        $path = $this->module->getModulePath($this->getName()) . 'module.json';
515
+        $path = $this->module->getModulePath($this->getName()).'module.json';
516 516
 
517 517
         $content = $this->filesystem->get($path);
518 518
         $namespace = $this->getModuleNamespaceReplacement();
519 519
         $studlyName = $this->getStudlyNameReplacement();
520 520
 
521
-        $provider = '"' . $namespace . '\\\\' . $studlyName . '\\\\Providers\\\\' . $studlyName . 'ServiceProvider"';
521
+        $provider = '"'.$namespace.'\\\\'.$studlyName.'\\\\Providers\\\\'.$studlyName.'ServiceProvider"';
522 522
 
523 523
         $content = str_replace($provider, '', $content);
524 524
 
@@ -572,7 +572,7 @@  discard block
 block discarded – undo
572 572
      */
573 573
     private function getControllerNamespaceReplacement(): string
574 574
     {
575
-        return str_replace('/', '\\', $this->module->config('paths.generator.controller.namespace') ?: ltrim($this->module->config('paths.generator.controller.path', 'Controller'),config('modules.paths.app_folder')));
575
+        return str_replace('/', '\\', $this->module->config('paths.generator.controller.namespace') ?: ltrim($this->module->config('paths.generator.controller.path', 'Controller'), config('modules.paths.app_folder')));
576 576
     }
577 577
 
578 578
     /**
Please login to merge, or discard this patch.
src/Commands/ComposerUpdateCommand.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -24,21 +24,21 @@  discard block
 block discarded – undo
24 24
     {
25 25
         $module = $this->getModuleModel($name);
26 26
 
27
-        $this->components->task("Updating Composer.json <fg=cyan;options=bold>{$module->getName()}</> Module", function () use ($module) {
27
+        $this->components->task("Updating Composer.json <fg=cyan;options=bold>{$module->getName()}</> Module", function() use ($module) {
28 28
 
29
-            $composer_path = $module->getPath() . DIRECTORY_SEPARATOR . 'composer.json';
29
+            $composer_path = $module->getPath().DIRECTORY_SEPARATOR.'composer.json';
30 30
 
31 31
             $composer = json_decode(File::get($composer_path), TRUE);
32 32
 
33 33
             $autoload = data_get($composer, 'autoload.psr-4');
34 34
 
35
-            if (! $autoload) {
35
+            if (!$autoload) {
36 36
                 return;
37 37
             }
38 38
 
39 39
             $key_name_with_app = sprintf('Modules\\%s\\App\\', $module->getStudlyName());
40 40
 
41
-            if (! array_key_exists($key_name_with_app, $autoload) ) {
41
+            if (!array_key_exists($key_name_with_app, $autoload)) {
42 42
                 return;
43 43
             }
44 44
 
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
         });
54 54
     }
55 55
 
56
-    function getInfo(): string|null
56
+    function getInfo(): string | null
57 57
     {
58 58
         return 'Updating Composer.json of modules...';
59 59
     }
Please login to merge, or discard this patch.
src/Commands/Make/ControllerMakeCommand.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 
46 46
         $controllerPath = GenerateConfigReader::read('controller');
47 47
 
48
-        return $path . $controllerPath->getPath() . '/' . $this->getControllerName() . '.php';
48
+        return $path.$controllerPath->getPath().'/'.$this->getControllerName().'.php';
49 49
     }
50 50
 
51 51
     /**
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
 
118 118
     public function getDefaultNamespace(): string
119 119
     {
120
-        return config('modules.paths.generator.controller.namespace' )
121
-            ?? ltrim(config('modules.paths.generator.controller.path','Http/Controllers'),config('modules.paths.app_folder'));
120
+        return config('modules.paths.generator.controller.namespace')
121
+            ?? ltrim(config('modules.paths.generator.controller.path', 'Http/Controllers'), config('modules.paths.app_folder'));
122 122
     }
123 123
 
124 124
     /**
Please login to merge, or discard this patch.
src/Commands/Make/ProviderMakeCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
         /** @var Module $module */
77 77
         $module = $this->laravel['modules']->findOrFail($this->getModuleName());
78 78
 
79
-        return (new Stub('/' . $stub . '.stub', [
79
+        return (new Stub('/'.$stub.'.stub', [
80 80
             'NAMESPACE'        => $this->getClassNamespace($module),
81 81
             'CLASS'            => $this->getClass(),
82 82
             'LOWER_NAME'       => $module->getLowerName(),
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 
102 102
         $generatorPath = GenerateConfigReader::read('provider');
103 103
 
104
-        return $path . $generatorPath->getPath() . '/' . $this->getFileName() . '.php';
104
+        return $path.$generatorPath->getPath().'/'.$this->getFileName().'.php';
105 105
     }
106 106
 
107 107
     /**
Please login to merge, or discard this patch.
src/Commands/Make/MigrationMakeCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 
117 117
         $generatorPath = GenerateConfigReader::read('migration');
118 118
 
119
-        return $path . $generatorPath->getPath() . '/' . $this->getFileName() . '.php';
119
+        return $path.$generatorPath->getPath().'/'.$this->getFileName().'.php';
120 120
     }
121 121
 
122 122
     /**
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
      */
125 125
     private function getFileName()
126 126
     {
127
-        return date('Y_m_d_His_') . $this->getSchemaName();
127
+        return date('Y_m_d_His_').$this->getSchemaName();
128 128
     }
129 129
 
130 130
     /**
Please login to merge, or discard this patch.
src/Commands/Make/RouteProviderMakeCommand.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 
88 88
         $generatorPath = GenerateConfigReader::read('provider');
89 89
 
90
-        return $path . $generatorPath->getPath() . '/' . $this->getFileName() . '.php';
90
+        return $path.$generatorPath->getPath().'/'.$this->getFileName().'.php';
91 91
     }
92 92
 
93 93
     /**
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
      */
96 96
     protected function getWebRoutesPath()
97 97
     {
98
-        return '/' . $this->laravel['modules']->config('stubs.files.routes/web', 'Routes/web.php');
98
+        return '/'.$this->laravel['modules']->config('stubs.files.routes/web', 'Routes/web.php');
99 99
     }
100 100
 
101 101
     /**
@@ -103,13 +103,13 @@  discard block
 block discarded – undo
103 103
      */
104 104
     protected function getApiRoutesPath()
105 105
     {
106
-        return '/' . $this->laravel['modules']->config('stubs.files.routes/api', 'Routes/api.php');
106
+        return '/'.$this->laravel['modules']->config('stubs.files.routes/api', 'Routes/api.php');
107 107
     }
108 108
 
109 109
     public function getDefaultNamespace(): string
110 110
     {
111
-        return config('modules.paths.generator.provider.namespace' )
112
-            ?? ltrim(config('modules.paths.generator.provider.path','Providers'),config('modules.paths.app_folder',''));
111
+        return config('modules.paths.generator.provider.namespace')
112
+            ?? ltrim(config('modules.paths.generator.provider.path', 'Providers'), config('modules.paths.app_folder', ''));
113 113
     }
114 114
 
115 115
     /**
Please login to merge, or discard this patch.
src/Commands/Make/ComponentViewMakeCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
         $path = $this->laravel['modules']->getModulePath($this->getModuleName());
64 64
         $factoryPath = GenerateConfigReader::read('component-view');
65 65
 
66
-        return $path . $factoryPath->getPath() . '/' . $this->getFileName();
66
+        return $path.$factoryPath->getPath().'/'.$this->getFileName();
67 67
     }
68 68
 
69 69
     /**
@@ -71,6 +71,6 @@  discard block
 block discarded – undo
71 71
      */
72 72
     private function getFileName()
73 73
     {
74
-        return Str::lower($this->argument('name')) . '.blade.php';
74
+        return Str::lower($this->argument('name')).'.blade.php';
75 75
     }
76 76
 }
Please login to merge, or discard this patch.
src/Commands/Make/TestMakeCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@
 block discarded – undo
80 80
             $testPath = GenerateConfigReader::read('test-unit');
81 81
         }
82 82
 
83
-        return $path . $testPath->getPath() . '/' . $this->getFileName() . '.php';
83
+        return $path.$testPath->getPath().'/'.$this->getFileName().'.php';
84 84
     }
85 85
 
86 86
     /**
Please login to merge, or discard this patch.