@@ -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 | /** |