@@ -21,9 +21,9 @@ discard block |
||
| 21 | 21 | { |
| 22 | 22 | $path = $this->laravel['modules']->getModulePath($this->getModuleName()); |
| 23 | 23 | |
| 24 | - $filePath = GenerateConfigReader::read('exceptions')->getPath() ?? config('modules.paths.app_folder') . 'Exceptions'; |
|
| 24 | + $filePath = GenerateConfigReader::read('exceptions')->getPath() ?? config('modules.paths.app_folder').'Exceptions'; |
|
| 25 | 25 | |
| 26 | - return $path . $filePath . '/' . $this->getExceptionName() . '.php'; |
|
| 26 | + return $path.$filePath.'/'.$this->getExceptionName().'.php'; |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | protected function getTemplateContents(): string |
@@ -56,12 +56,12 @@ discard block |
||
| 56 | 56 | ]; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - protected function getExceptionName(): array|string |
|
| 59 | + protected function getExceptionName(): array | string |
|
| 60 | 60 | { |
| 61 | 61 | return Str::studly($this->argument('name')); |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - private function getClassNameWithoutNamespace(): array|string |
|
| 64 | + private function getClassNameWithoutNamespace(): array | string |
|
| 65 | 65 | { |
| 66 | 66 | return class_basename($this->getExceptionName()); |
| 67 | 67 | } |
@@ -21,9 +21,9 @@ discard block |
||
| 21 | 21 | { |
| 22 | 22 | $path = $this->laravel['modules']->getModulePath($this->getModuleName()); |
| 23 | 23 | |
| 24 | - $filePath = GenerateConfigReader::read('interfaces')->getPath() ?? config('modules.paths.app_folder') . 'Interfaces'; |
|
| 24 | + $filePath = GenerateConfigReader::read('interfaces')->getPath() ?? config('modules.paths.app_folder').'Interfaces'; |
|
| 25 | 25 | |
| 26 | - return $path . $filePath . '/' . $this->getInterfaceName() . '.php'; |
|
| 26 | + return $path.$filePath.'/'.$this->getInterfaceName().'.php'; |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | protected function getTemplateContents(): string |
@@ -54,12 +54,12 @@ discard block |
||
| 54 | 54 | ]; |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - protected function getInterfaceName(): array|string |
|
| 57 | + protected function getInterfaceName(): 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->getInterfaceName()); |
| 65 | 65 | } |
@@ -21,9 +21,9 @@ discard block |
||
| 21 | 21 | { |
| 22 | 22 | $path = $this->laravel['modules']->getModulePath($this->getModuleName()); |
| 23 | 23 | |
| 24 | - $filePath = GenerateConfigReader::read('scopes')->getPath() ?? config('modules.paths.generator.model.path') . '/Scopes'; |
|
| 24 | + $filePath = GenerateConfigReader::read('scopes')->getPath() ?? config('modules.paths.generator.model.path').'/Scopes'; |
|
| 25 | 25 | |
| 26 | - return $path . $filePath . '/' . $this->getScopeName() . '.php'; |
|
| 26 | + return $path.$filePath.'/'.$this->getScopeName().'.php'; |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | protected function getTemplateContents(): string |
@@ -54,12 +54,12 @@ discard block |
||
| 54 | 54 | ]; |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - protected function getScopeName(): array|string |
|
| 57 | + protected function getScopeName(): 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->getScopeName()); |
| 65 | 65 | } |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | |
| 24 | 24 | $filePath = GenerateConfigReader::read('provider')->getPath(); |
| 25 | 25 | |
| 26 | - return $path . $filePath . '/' . $this->getEventServiceProviderName() . '.php'; |
|
| 26 | + return $path.$filePath.'/'.$this->getEventServiceProviderName().'.php'; |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | protected function getTemplateContents(): string |
@@ -53,12 +53,12 @@ discard block |
||
| 53 | 53 | ]; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - protected function getEventServiceProviderName(): array|string |
|
| 56 | + protected function getEventServiceProviderName(): array | string |
|
| 57 | 57 | { |
| 58 | 58 | return Str::studly('EventServiceProvider'); |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | - private function getClassNameWithoutNamespace(): array|string |
|
| 61 | + private function getClassNameWithoutNamespace(): array | string |
|
| 62 | 62 | { |
| 63 | 63 | return class_basename($this->getEventServiceProviderName()); |
| 64 | 64 | } |
@@ -406,7 +406,7 @@ discard block |
||
| 406 | 406 | continue; |
| 407 | 407 | } |
| 408 | 408 | |
| 409 | - $path = $this->module->getModulePath($this->getName()) . '/' . $folder->getPath(); |
|
| 409 | + $path = $this->module->getModulePath($this->getName()).'/'.$folder->getPath(); |
|
| 410 | 410 | |
| 411 | 411 | $this->filesystem->ensureDirectoryExists($path, 0755, true); |
| 412 | 412 | if (config('modules.stubs.gitkeep')) { |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | */ |
| 423 | 423 | public function generateGitKeep($path) |
| 424 | 424 | { |
| 425 | - $this->filesystem->put($path . '/.gitkeep', ''); |
|
| 425 | + $this->filesystem->put($path.'/.gitkeep', ''); |
|
| 426 | 426 | } |
| 427 | 427 | |
| 428 | 428 | /** |
@@ -431,9 +431,9 @@ discard block |
||
| 431 | 431 | public function generateFiles() |
| 432 | 432 | { |
| 433 | 433 | foreach ($this->getFiles() as $stub => $file) { |
| 434 | - $path = $this->module->getModulePath($this->getName()) . $file; |
|
| 434 | + $path = $this->module->getModulePath($this->getName()).$file; |
|
| 435 | 435 | |
| 436 | - $this->component->task("Generating file {$path}", function () use ($stub, $path) { |
|
| 436 | + $this->component->task("Generating file {$path}", function() use ($stub, $path) { |
|
| 437 | 437 | if (!$this->filesystem->isDirectory($dir = dirname($path))) { |
| 438 | 438 | $this->filesystem->makeDirectory($dir, 0775, true); |
| 439 | 439 | } |
@@ -459,14 +459,14 @@ discard block |
||
| 459 | 459 | $providerGenerator = GenerateConfigReader::read('provider'); |
| 460 | 460 | if ($providerGenerator->generate() === true) { |
| 461 | 461 | $this->console->call('module:make-provider', [ |
| 462 | - 'name' => $this->getName() . 'ServiceProvider', |
|
| 462 | + 'name' => $this->getName().'ServiceProvider', |
|
| 463 | 463 | 'module' => $this->getName(), |
| 464 | 464 | '--master' => true, |
| 465 | 465 | ]); |
| 466 | 466 | } else { |
| 467 | 467 | // delete register ServiceProvider on module.json |
| 468 | - $path = $this->module->getModulePath($this->getName()) . DIRECTORY_SEPARATOR . 'module.json'; |
|
| 469 | - $module_file = $this->filesystem->get($path); |
|
| 468 | + $path = $this->module->getModulePath($this->getName()).DIRECTORY_SEPARATOR.'module.json'; |
|
| 469 | + $module_file = $this->filesystem->get($path); |
|
| 470 | 470 | $this->filesystem->put( |
| 471 | 471 | $path, |
| 472 | 472 | preg_replace('/"providers": \[.*?\],/s', '"providers": [ ],', $module_file) |
@@ -487,7 +487,7 @@ discard block |
||
| 487 | 487 | $this->filesystem->replaceInFile( |
| 488 | 488 | '$this->app->register(Event', |
| 489 | 489 | '// $this->app->register(Event', |
| 490 | - $this->module->getModulePath($this->getName()) . DIRECTORY_SEPARATOR . $providerGenerator->getPath() . DIRECTORY_SEPARATOR . sprintf('%sServiceProvider.php', $this->getName()) |
|
| 490 | + $this->module->getModulePath($this->getName()).DIRECTORY_SEPARATOR.$providerGenerator->getPath().DIRECTORY_SEPARATOR.sprintf('%sServiceProvider.php', $this->getName()) |
|
| 491 | 491 | ); |
| 492 | 492 | } |
| 493 | 493 | } |
@@ -506,7 +506,7 @@ discard block |
||
| 506 | 506 | $this->filesystem->replaceInFile( |
| 507 | 507 | '$this->app->register(Route', |
| 508 | 508 | '// $this->app->register(Route', |
| 509 | - $this->module->getModulePath($this->getName()) . DIRECTORY_SEPARATOR . $providerGenerator->getPath() . DIRECTORY_SEPARATOR . sprintf('%sServiceProvider.php', $this->getName()) |
|
| 509 | + $this->module->getModulePath($this->getName()).DIRECTORY_SEPARATOR.$providerGenerator->getPath().DIRECTORY_SEPARATOR.sprintf('%sServiceProvider.php', $this->getName()) |
|
| 510 | 510 | ); |
| 511 | 511 | } |
| 512 | 512 | } |
@@ -514,7 +514,7 @@ discard block |
||
| 514 | 514 | if (GenerateConfigReader::read('controller')->generate() === true) { |
| 515 | 515 | $options = $this->type == 'api' ? ['--api' => true] : []; |
| 516 | 516 | $this->console->call('module:make-controller', [ |
| 517 | - 'controller' => $this->getName() . 'Controller', |
|
| 517 | + 'controller' => $this->getName().'Controller', |
|
| 518 | 518 | 'module' => $this->getName(), |
| 519 | 519 | ] + $options); |
| 520 | 520 | } |
@@ -530,7 +530,7 @@ discard block |
||
| 530 | 530 | protected function getStubContents($stub) |
| 531 | 531 | { |
| 532 | 532 | return (new Stub( |
| 533 | - '/' . $stub . '.stub', |
|
| 533 | + '/'.$stub.'.stub', |
|
| 534 | 534 | $this->getReplacement($stub) |
| 535 | 535 | ) |
| 536 | 536 | )->render(); |
@@ -573,7 +573,7 @@ discard block |
||
| 573 | 573 | } |
| 574 | 574 | } |
| 575 | 575 | foreach ($keys as $key) { |
| 576 | - if (method_exists($this, $method = 'get' . ucfirst(Str::studly(strtolower($key))) . 'Replacement')) { |
|
| 576 | + if (method_exists($this, $method = 'get'.ucfirst(Str::studly(strtolower($key))).'Replacement')) { |
|
| 577 | 577 | $replaces[$key] = $this->$method(); |
| 578 | 578 | } else { |
| 579 | 579 | $replaces[$key] = null; |
@@ -588,9 +588,9 @@ discard block |
||
| 588 | 588 | */ |
| 589 | 589 | private function generateModuleJsonFile() |
| 590 | 590 | { |
| 591 | - $path = $this->module->getModulePath($this->getName()) . 'module.json'; |
|
| 591 | + $path = $this->module->getModulePath($this->getName()).'module.json'; |
|
| 592 | 592 | |
| 593 | - $this->component->task("Generating file $path", function () use ($path) { |
|
| 593 | + $this->component->task("Generating file $path", function() use ($path) { |
|
| 594 | 594 | if (!$this->filesystem->isDirectory($dir = dirname($path))) { |
| 595 | 595 | $this->filesystem->makeDirectory($dir, 0775, true); |
| 596 | 596 | } |
@@ -605,13 +605,13 @@ discard block |
||
| 605 | 605 | */ |
| 606 | 606 | private function cleanModuleJsonFile() |
| 607 | 607 | { |
| 608 | - $path = $this->module->getModulePath($this->getName()) . 'module.json'; |
|
| 608 | + $path = $this->module->getModulePath($this->getName()).'module.json'; |
|
| 609 | 609 | |
| 610 | 610 | $content = $this->filesystem->get($path); |
| 611 | 611 | $namespace = $this->getModuleNamespaceReplacement(); |
| 612 | 612 | $studlyName = $this->getStudlyNameReplacement(); |
| 613 | 613 | |
| 614 | - $provider = '"' . $namespace . '\\\\' . $studlyName . '\\\\Providers\\\\' . $studlyName . 'ServiceProvider"'; |
|
| 614 | + $provider = '"'.$namespace.'\\\\'.$studlyName.'\\\\Providers\\\\'.$studlyName.'ServiceProvider"'; |
|
| 615 | 615 | |
| 616 | 616 | $content = str_replace($provider, '', $content); |
| 617 | 617 | |
@@ -35,8 +35,8 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | public function module_namespace(string $module, ?string $path = null): string |
| 37 | 37 | { |
| 38 | - $module_namespace = config('modules.namespace', $this->path_namespace(config('modules.paths.modules'))) . '\\' . ($module); |
|
| 39 | - $module_namespace .= strlen($path) ? '\\' . $this->path_namespace($path) : ''; |
|
| 38 | + $module_namespace = config('modules.namespace', $this->path_namespace(config('modules.paths.modules'))).'\\'.($module); |
|
| 39 | + $module_namespace .= strlen($path) ? '\\'.$this->path_namespace($path) : ''; |
|
| 40 | 40 | |
| 41 | 41 | return $this->studly_namespace($module_namespace); |
| 42 | 42 | } |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | { |
| 57 | 57 | $config_path = config('modules.paths.app_folder'); |
| 58 | 58 | $app_path = strlen($config_path) ? trim($config_path, '/') : 'app'; |
| 59 | - $app_path .= strlen($path) ? '/' . $path : ''; |
|
| 59 | + $app_path .= strlen($path) ? '/'.$path : ''; |
|
| 60 | 60 | |
| 61 | 61 | return $this->clean_path($app_path); |
| 62 | 62 | } |
@@ -46,7 +46,7 @@ discard block |
||
| 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 | }); |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | { |
| 91 | 91 | $path_namespace = $this->path_namespace(str_replace($this->getClass(), '', $this->argument($this->argumentName))); |
| 92 | 92 | |
| 93 | - return $this->module_namespace($module->getStudlyName(), $this->getDefaultNamespace() . ($path_namespace ? '\\' . $path_namespace : '')); |
|
| 93 | + return $this->module_namespace($module->getStudlyName(), $this->getDefaultNamespace().($path_namespace ? '\\'.$path_namespace : '')); |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | /** |
@@ -98,6 +98,6 @@ discard block |
||
| 98 | 98 | */ |
| 99 | 99 | public function path(?string $path = null): string |
| 100 | 100 | { |
| 101 | - return $this->clean_path($this->laravel['modules']->getModulePath($this->getModuleName()) . (strlen($path) ? '/' . $path : '')); |
|
| 101 | + return $this->clean_path($this->laravel['modules']->getModulePath($this->getModuleName()).(strlen($path) ? '/'.$path : '')); |
|
| 102 | 102 | } |
| 103 | 103 | } |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | { |
| 44 | 44 | $app_path = GenerateConfigReader::read('class')->getPath() ?? $this->app_path('Classes'); |
| 45 | 45 | |
| 46 | - return $this->path($this->type_path($app_path) . '/' . $this->getFileName() . '.php'); |
|
| 46 | + return $this->path($this->type_path($app_path).'/'.$this->getFileName().'.php'); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | protected function getFileName(): string |