@@ -21,9 +21,9 @@ discard block |
||
| 21 | 21 | { |
| 22 | 22 | $path = $this->laravel['modules']->getModulePath($this->getModuleName()); |
| 23 | 23 | |
| 24 | - $filePath = GenerateConfigReader::read('traits')->getPath() ?? config('modules.paths.app_folder') . 'Traits'; |
|
| 24 | + $filePath = GenerateConfigReader::read('traits')->getPath() ?? config('modules.paths.app_folder').'Traits'; |
|
| 25 | 25 | |
| 26 | - return $path . $filePath . '/' . $this->getTraitName() . '.php'; |
|
| 26 | + return $path.$filePath.'/'.$this->getTraitName().'.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 getTraitName(): array|string |
|
| 57 | + protected function getTraitName(): 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->getTraitName()); |
| 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('casts')->getPath() ?? config('modules.paths.app_folder') . 'Casts'; |
|
| 24 | + $filePath = GenerateConfigReader::read('casts')->getPath() ?? config('modules.paths.app_folder').'Casts'; |
|
| 25 | 25 | |
| 26 | - return $path . $filePath . '/' . $this->getCastName() . '.php'; |
|
| 26 | + return $path.$filePath.'/'.$this->getCastName().'.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 getCastName(): array|string |
|
| 57 | + protected function getCastName(): 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->getCastName()); |
| 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('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 | |
@@ -22,8 +22,8 @@ discard block |
||
| 22 | 22 | { |
| 23 | 23 | $module = $this->getModuleModel($name); |
| 24 | 24 | |
| 25 | - $this->components->task("Updating <fg=cyan;options=bold>{$module->getName()}</>", function () use ($module) { |
|
| 26 | - $composer_file = $module->getPath() . DIRECTORY_SEPARATOR . 'composer.json'; |
|
| 25 | + $this->components->task("Updating <fg=cyan;options=bold>{$module->getName()}</>", function() use ($module) { |
|
| 26 | + $composer_file = $module->getPath().DIRECTORY_SEPARATOR.'composer.json'; |
|
| 27 | 27 | $composer = json_decode(File::get($composer_file), true); |
| 28 | 28 | |
| 29 | 29 | $autoload_psr4 = data_get($composer, 'autoload.psr-4') ?? []; |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | // Get the module name. |
| 33 | 33 | $name = $module->getStudlyName(); |
| 34 | - $app_path = trim(strlen($path = config('modules.paths.app_folder')) ? $path : 'app', '/') . '/'; // accept app_path option |
|
| 34 | + $app_path = trim(strlen($path = config('modules.paths.app_folder')) ? $path : 'app', '/').'/'; // accept app_path option |
|
| 35 | 35 | $app_path_name = trim($app_path, '/'); |
| 36 | 36 | |
| 37 | 37 | // Remove old app key |