@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | $string = ''; |
| 59 | 59 | foreach ($pieces as $i => $piece) { |
| 60 | 60 | if ($i + 1 < count($pieces)) { |
| 61 | - $string .= strtolower($piece) . '_'; |
|
| 61 | + $string .= strtolower($piece).'_'; |
|
| 62 | 62 | } else { |
| 63 | 63 | $string .= Str::plural(strtolower($piece)); |
| 64 | 64 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | private function handleOptionalMigrationOption() |
| 100 | 100 | { |
| 101 | 101 | if ($this->option('migration') === true) { |
| 102 | - $migrationName = 'create_' . $this->createMigrationName() . '_table'; |
|
| 102 | + $migrationName = 'create_'.$this->createMigrationName().'_table'; |
|
| 103 | 103 | $this->call('module:make-migration', ['name' => $migrationName, 'module' => $this->argument('module')]); |
| 104 | 104 | } |
| 105 | 105 | } |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | $modelPath = GenerateConfigReader::read('model'); |
| 134 | 134 | |
| 135 | - return $path . $modelPath->getPath() . '/' . $this->getModelName() . '.php'; |
|
| 135 | + return $path.$modelPath->getPath().'/'.$this->getModelName().'.php'; |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | /** |
@@ -36,8 +36,8 @@ discard block |
||
| 36 | 36 | */ |
| 37 | 37 | protected function registerNamespaces() |
| 38 | 38 | { |
| 39 | - $configPath = __DIR__ . '/../config/config.php'; |
|
| 40 | - $stubsPath = dirname(__DIR__) . '/src/Commands/stubs'; |
|
| 39 | + $configPath = __DIR__.'/../config/config.php'; |
|
| 40 | + $stubsPath = dirname(__DIR__).'/src/Commands/stubs'; |
|
| 41 | 41 | |
| 42 | 42 | $this->publishes([ |
| 43 | 43 | $configPath => config_path('modules.php'), |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | ], 'stubs'); |
| 49 | 49 | |
| 50 | 50 | $this->publishes([ |
| 51 | - __DIR__ . '/../scripts/vite-module-loader.js' => base_path('vite-module-loader.js'), |
|
| 51 | + __DIR__.'/../scripts/vite-module-loader.js' => base_path('vite-module-loader.js'), |
|
| 52 | 52 | ], 'vite'); |
| 53 | 53 | } |
| 54 | 54 | |
@@ -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 | ]); |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | if (GenerateConfigReader::read('controller')->generate() === true) { |
| 424 | 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 | 428 | ] + $options); |
| 429 | 429 | } |
@@ -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(); |
@@ -478,7 +478,7 @@ discard block |
||
| 478 | 478 | } |
| 479 | 479 | } |
| 480 | 480 | foreach ($keys as $key) { |
| 481 | - if (method_exists($this, $method = 'get' . ucfirst(Str::studly(strtolower($key))) . 'Replacement')) { |
|
| 481 | + if (method_exists($this, $method = 'get'.ucfirst(Str::studly(strtolower($key))).'Replacement')) { |
|
| 482 | 482 | $replaces[$key] = $this->$method(); |
| 483 | 483 | } else { |
| 484 | 484 | $replaces[$key] = null; |
@@ -493,9 +493,9 @@ discard block |
||
| 493 | 493 | */ |
| 494 | 494 | private function generateModuleJsonFile() |
| 495 | 495 | { |
| 496 | - $path = $this->module->getModulePath($this->getName()) . 'module.json'; |
|
| 496 | + $path = $this->module->getModulePath($this->getName()).'module.json'; |
|
| 497 | 497 | |
| 498 | - $this->component->task("Generating file $path", function () use ($path) { |
|
| 498 | + $this->component->task("Generating file $path", function() use ($path) { |
|
| 499 | 499 | if (!$this->filesystem->isDirectory($dir = dirname($path))) { |
| 500 | 500 | $this->filesystem->makeDirectory($dir, 0775, true); |
| 501 | 501 | } |
@@ -510,13 +510,13 @@ discard block |
||
| 510 | 510 | */ |
| 511 | 511 | private function cleanModuleJsonFile() |
| 512 | 512 | { |
| 513 | - $path = $this->module->getModulePath($this->getName()) . 'module.json'; |
|
| 513 | + $path = $this->module->getModulePath($this->getName()).'module.json'; |
|
| 514 | 514 | |
| 515 | 515 | $content = $this->filesystem->get($path); |
| 516 | 516 | $namespace = $this->getModuleNamespaceReplacement(); |
| 517 | 517 | $studlyName = $this->getStudlyNameReplacement(); |
| 518 | 518 | |
| 519 | - $provider = '"' . $namespace . '\\\\' . $studlyName . '\\\\Providers\\\\' . $studlyName . 'ServiceProvider"'; |
|
| 519 | + $provider = '"'.$namespace.'\\\\'.$studlyName.'\\\\Providers\\\\'.$studlyName.'ServiceProvider"'; |
|
| 520 | 520 | |
| 521 | 521 | $content = str_replace($provider, '', $content); |
| 522 | 522 | |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | abstract public function executeAction($name); |
| 42 | 42 | |
| 43 | - public function getInfo(): string|null |
|
| 43 | + public function getInfo(): string | null |
|
| 44 | 44 | { |
| 45 | 45 | return null; |
| 46 | 46 | } |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | public function handle() |
| 52 | 52 | { |
| 53 | - if (! is_null($info = $this->getInfo())) { |
|
| 53 | + if (!is_null($info = $this->getInfo())) { |
|
| 54 | 54 | $this->components->info($info); |
| 55 | 55 | } |
| 56 | 56 | |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | return; |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - if (! empty($input->getArgument('module'))) { |
|
| 74 | + if (!empty($input->getArgument('module'))) { |
|
| 75 | 75 | return; |
| 76 | 76 | } |
| 77 | 77 | |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | $database = $this->option('database'); |
| 34 | 34 | |
| 35 | - if (! empty($database)) { |
|
| 35 | + if (!empty($database)) { |
|
| 36 | 36 | $migrator->setDatabase($database); |
| 37 | 37 | } |
| 38 | 38 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | $this->components->warn("Nothing to rollback on module <fg=cyan;options=bold>{$module->getName()}</>"); |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | - public function getInfo(): string|null |
|
| 52 | + public function getInfo(): string | null |
|
| 53 | 53 | { |
| 54 | 54 | return null; |
| 55 | 55 | } |
@@ -22,12 +22,12 @@ |
||
| 22 | 22 | { |
| 23 | 23 | $module = $this->getModuleModel($name); |
| 24 | 24 | |
| 25 | - $this->components->task("Updating <fg=cyan;options=bold>{$module->getName()}</> Module", function () use ($module) { |
|
| 25 | + $this->components->task("Updating <fg=cyan;options=bold>{$module->getName()}</> Module", function() use ($module) { |
|
| 26 | 26 | $this->laravel['modules']->update($module); |
| 27 | 27 | }); |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - public function getInfo(): string|null |
|
| 30 | + public function getInfo(): string | null |
|
| 31 | 31 | { |
| 32 | 32 | return 'Updating Module ...'; |
| 33 | 33 | } |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | $path = str_replace('/', '\\', $path); |
| 74 | 74 | |
| 75 | - return $this->laravel['modules']->config('namespace') . '\\' . $this->laravel['modules']->findOrFail($this->getModuleName()) . '\\' . $path; |
|
| 75 | + return $this->laravel['modules']->config('namespace').'\\'.$this->laravel['modules']->findOrFail($this->getModuleName()).'\\'.$path; |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | /** |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | private function getModelVariable(): string |
| 90 | 90 | { |
| 91 | - return '$' . Str::lower($this->argument('name')); |
|
| 91 | + return '$'.Str::lower($this->argument('name')); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | /** |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | |
| 101 | 101 | $observerPath = GenerateConfigReader::read('observer'); |
| 102 | 102 | |
| 103 | - return $path . $observerPath->getPath() . '/' . $this->getFileName(); |
|
| 103 | + return $path.$observerPath->getPath().'/'.$this->getFileName(); |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | /** |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | */ |
| 109 | 109 | private function getFileName() |
| 110 | 110 | { |
| 111 | - return Str::studly($this->argument('name')) . 'Observer.php'; |
|
| 111 | + return Str::studly($this->argument('name')).'Observer.php'; |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | public function handle(): int |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | $contents = $this->getTemplateContents(); |
| 44 | 44 | |
| 45 | 45 | try { |
| 46 | - $this->components->task("Generating file {$path}", function () use ($path, $contents) { |
|
| 46 | + $this->components->task("Generating file {$path}", function() use ($path, $contents) { |
|
| 47 | 47 | $overwriteFile = $this->hasOption('force') ? $this->option('force') : false; |
| 48 | 48 | (new FileGenerator($path, $contents))->withFileOverwrite($overwriteFile)->generate(); |
| 49 | 49 | }); |
@@ -92,11 +92,11 @@ discard block |
||
| 92 | 92 | |
| 93 | 93 | $namespace = $this->laravel['modules']->config('namespace'); |
| 94 | 94 | |
| 95 | - $namespace .= '\\' . $module->getStudlyName(); |
|
| 95 | + $namespace .= '\\'.$module->getStudlyName(); |
|
| 96 | 96 | |
| 97 | - $namespace .= '\\' . $this->getDefaultNamespace(); |
|
| 97 | + $namespace .= '\\'.$this->getDefaultNamespace(); |
|
| 98 | 98 | |
| 99 | - $namespace .= '\\' . $extra; |
|
| 99 | + $namespace .= '\\'.$extra; |
|
| 100 | 100 | |
| 101 | 101 | $namespace = str_replace('/', '\\', $namespace); |
| 102 | 102 | |
@@ -33,12 +33,12 @@ |
||
| 33 | 33 | ? '<fg=red;options=bold>Disabled</>' |
| 34 | 34 | : '<fg=green;options=bold>Enabled</>'; |
| 35 | 35 | |
| 36 | - $this->components->task("Disabling <fg=cyan;options=bold>{$module->getName()}</> Module, old status: $status", function () use ($module) { |
|
| 36 | + $this->components->task("Disabling <fg=cyan;options=bold>{$module->getName()}</> Module, old status: $status", function() use ($module) { |
|
| 37 | 37 | $module->disable(); |
| 38 | 38 | }); |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - public function getInfo(): string|null |
|
| 41 | + public function getInfo(): string | null |
|
| 42 | 42 | { |
| 43 | 43 | return 'Disabling module ...'; |
| 44 | 44 | } |