@@ -359,7 +359,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | /** |
@@ -45,7 +45,7 @@ discard block |
||
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 |
||
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 | /** |
@@ -87,7 +87,7 @@ discard block |
||
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 |
||
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 |
||
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 | /** |
@@ -76,7 +76,7 @@ discard block |
||
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 |
||
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 | /** |
@@ -24,21 +24,21 @@ discard block |
||
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 |
||
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 | } |