@@ -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,9 +46,9 @@ |
||
46 | 46 | { |
47 | 47 | $path = $this->laravel['modules']->getModulePath($this->getModuleName()); |
48 | 48 | |
49 | - $filePath = GenerateConfigReader::read('class')->getPath() ?? config('modules.paths.app_folder') . 'Classes'; |
|
49 | + $filePath = GenerateConfigReader::read('class')->getPath() ?? config('modules.paths.app_folder').'Classes'; |
|
50 | 50 | |
51 | - return $this->typePath($path . $filePath . '/' . $this->getFileName() . '.php'); |
|
51 | + return $this->typePath($path.$filePath.'/'.$this->getFileName().'.php'); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | protected function getFileName(): string |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $contents = $this->getTemplateContents(); |
48 | 48 | |
49 | 49 | try { |
50 | - $this->components->task("Generating file {$path}", function () use ($path, $contents) { |
|
50 | + $this->components->task("Generating file {$path}", function() use ($path, $contents) { |
|
51 | 51 | $overwriteFile = $this->hasOption('force') ? $this->option('force') : false; |
52 | 52 | (new FileGenerator($path, $contents))->withFileOverwrite($overwriteFile)->generate(); |
53 | 53 | }); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | { |
92 | 92 | $path_namespace = $this->path_namespace(str_replace($this->getClass(), '', $this->argument($this->argumentName))); |
93 | 93 | |
94 | - return $this->module_namespace($module->getStudlyName(), $this->getDefaultNamespace() . ($path_namespace ? '\\' . $path_namespace : '')); |
|
94 | + return $this->module_namespace($module->getStudlyName(), $this->getDefaultNamespace().($path_namespace ? '\\'.$path_namespace : '')); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | public function module(?string $name = null): Module |
@@ -50,12 +50,12 @@ discard block |
||
50 | 50 | |
51 | 51 | abstract public function executeAction($name); |
52 | 52 | |
53 | - public function getInfo(): string|null |
|
53 | + public function getInfo(): string | null |
|
54 | 54 | { |
55 | 55 | return null; |
56 | 56 | } |
57 | 57 | |
58 | - public function getConfirmableLabel(): string|null |
|
58 | + public function getConfirmableLabel(): string | null |
|
59 | 59 | { |
60 | 60 | return 'Warning'; |
61 | 61 | } |
@@ -67,12 +67,12 @@ discard block |
||
67 | 67 | { |
68 | 68 | if ($this instanceof ConfirmableCommand) { |
69 | 69 | if ($this->isProhibited() || |
70 | - ! $this->confirmToProceed($this->getConfirmableLabel(), fn () => true)) { |
|
70 | + !$this->confirmToProceed($this->getConfirmableLabel(), fn () => true)) { |
|
71 | 71 | return 1; |
72 | 72 | } |
73 | 73 | } |
74 | 74 | |
75 | - if (! is_null($info = $this->getInfo())) { |
|
75 | + if (!is_null($info = $this->getInfo())) { |
|
76 | 76 | $this->components->info($info); |
77 | 77 | } |
78 | 78 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | return; |
96 | 96 | } |
97 | 97 | |
98 | - if (! empty($input->getArgument('module'))) { |
|
98 | + if (!empty($input->getArgument('module'))) { |
|
99 | 99 | return; |
100 | 100 | } |
101 | 101 |
@@ -36,7 +36,7 @@ |
||
36 | 36 | { |
37 | 37 | parent::__construct(); |
38 | 38 | |
39 | - $this->migrator = app('migrator'); |
|
39 | + $this->migrator = app('migrator'); |
|
40 | 40 | $this->migration_paths = collect($this->migrator->paths()); |
41 | 41 | } |
42 | 42 |
@@ -22,9 +22,9 @@ discard block |
||
22 | 22 | { |
23 | 23 | $path = $this->laravel['modules']->getModulePath($this->getModuleName()); |
24 | 24 | |
25 | - $filePath = GenerateConfigReader::read('repository')->getPath() ?? config('modules.paths.app_folder') . 'Repositories'; |
|
25 | + $filePath = GenerateConfigReader::read('repository')->getPath() ?? config('modules.paths.app_folder').'Repositories'; |
|
26 | 26 | |
27 | - return $path . $filePath . '/' . $this->getRepositoryName() . '.php'; |
|
27 | + return $path.$filePath.'/'.$this->getRepositoryName().'.php'; |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | protected function getTemplateContents(): string |
@@ -56,12 +56,12 @@ discard block |
||
56 | 56 | ]; |
57 | 57 | } |
58 | 58 | |
59 | - protected function getRepositoryName(): array|string |
|
59 | + protected function getRepositoryName(): 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->getRepositoryName()); |
67 | 67 | } |