@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | { |
183 | 183 | $lowerName = $this->getLowerName(); |
184 | 184 | |
185 | - $langPath = $this->getPath() . '/Resources/lang'; |
|
185 | + $langPath = $this->getPath().'/Resources/lang'; |
|
186 | 186 | |
187 | 187 | if (is_dir($langPath)) { |
188 | 188 | $this->loadTranslationsFrom($langPath, $lowerName); |
@@ -198,8 +198,8 @@ discard block |
||
198 | 198 | $file = 'module.json'; |
199 | 199 | } |
200 | 200 | |
201 | - return Arr::get($this->moduleJson, $file, function () use ($file) { |
|
202 | - return $this->moduleJson[$file] = new Json($this->getPath() . '/' . $file, $this->files); |
|
201 | + return Arr::get($this->moduleJson, $file, function() use ($file) { |
|
202 | + return $this->moduleJson[$file] = new Json($this->getPath().'/'.$file, $this->files); |
|
203 | 203 | }); |
204 | 204 | } |
205 | 205 | |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | */ |
241 | 241 | protected function fireEvent(string $event): void |
242 | 242 | { |
243 | - $this->app['events']->dispatch(sprintf('modules.%s.' . $event, $this->getLowerName()), [$this]); |
|
243 | + $this->app['events']->dispatch(sprintf('modules.%s.'.$event, $this->getLowerName()), [$this]); |
|
244 | 244 | } |
245 | 245 | |
246 | 246 | /** |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | protected function registerFiles(): void |
265 | 265 | { |
266 | 266 | foreach ($this->get('files', []) as $file) { |
267 | - include $this->path . '/' . $file; |
|
267 | + include $this->path.'/'.$file; |
|
268 | 268 | } |
269 | 269 | } |
270 | 270 | |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | */ |
350 | 350 | public function getExtraPath(string $path): string |
351 | 351 | { |
352 | - return $this->getPath() . '/' . $path; |
|
352 | + return $this->getPath().'/'.$path; |
|
353 | 353 | } |
354 | 354 | |
355 | 355 | /** |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | { |
71 | 71 | $path = $this->pathNamespace($this->laravel['modules']->config('paths.generator.model.path', 'app/Models')); |
72 | 72 | |
73 | - return $this->laravel['modules']->config('namespace') . '\\' . $this->laravel['modules']->findOrFail($this->getModuleName()) . '\\' . $path; |
|
73 | + return $this->laravel['modules']->config('namespace').'\\'.$this->laravel['modules']->findOrFail($this->getModuleName()).'\\'.$path; |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | */ |
87 | 87 | private function getModelVariable(): string |
88 | 88 | { |
89 | - return '$' . Str::lower($this->argument('name')); |
|
89 | + return '$'.Str::lower($this->argument('name')); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | /** |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | |
99 | 99 | $observerPath = GenerateConfigReader::read('observer'); |
100 | 100 | |
101 | - return $path . $observerPath->getPath() . '/' . $this->getFileName(); |
|
101 | + return $path.$observerPath->getPath().'/'.$this->getFileName(); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | /** |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | */ |
107 | 107 | private function getFileName() |
108 | 108 | { |
109 | - return Str::studly($this->argument('name')) . 'Observer.php'; |
|
109 | + return Str::studly($this->argument('name')).'Observer.php'; |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | public function handle(): int |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | 'NAMESPACE' => $this->getClassNamespace($module), |
81 | 81 | 'CLASS' => $this->getClass(), |
82 | 82 | 'LOWER_NAME' => $module->getLowerName(), |
83 | - 'COMPONENT_NAME' => 'components.' . Str::lower($this->argument('name')), |
|
83 | + 'COMPONENT_NAME' => 'components.'.Str::lower($this->argument('name')), |
|
84 | 84 | ]))->render(); |
85 | 85 | } |
86 | 86 | |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | $path = $this->laravel['modules']->getModulePath($this->getModuleName()); |
93 | 93 | $factoryPath = GenerateConfigReader::read('component-class'); |
94 | 94 | |
95 | - return $path . $factoryPath->getPath() . '/' . $this->getFileName(); |
|
95 | + return $path.$factoryPath->getPath().'/'.$this->getFileName(); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | /** |
@@ -100,6 +100,6 @@ discard block |
||
100 | 100 | */ |
101 | 101 | private function getFileName() |
102 | 102 | { |
103 | - return Str::studly($this->argument('name')) . '.php'; |
|
103 | + return Str::studly($this->argument('name')).'.php'; |
|
104 | 104 | } |
105 | 105 | } |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | $contents = $this->getTemplateContents(); |
45 | 45 | |
46 | 46 | try { |
47 | - $this->components->task("Generating file {$path}", function () use ($path, $contents) { |
|
47 | + $this->components->task("Generating file {$path}", function() use ($path, $contents) { |
|
48 | 48 | $overwriteFile = $this->hasOption('force') ? $this->option('force') : false; |
49 | 49 | (new FileGenerator($path, $contents))->withFileOverwrite($overwriteFile)->generate(); |
50 | 50 | }); |
@@ -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 = $this->pathNamespace($namespace); |
102 | 102 |
@@ -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,7 +103,7 @@ 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 |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | |
70 | 70 | $factoryPath = GenerateConfigReader::read('factory'); |
71 | 71 | |
72 | - return $path . $factoryPath->getPath() . '/' . $this->getFileName(); |
|
72 | + return $path.$factoryPath->getPath().'/'.$this->getFileName(); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | /** |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | */ |
78 | 78 | private function getFileName() |
79 | 79 | { |
80 | - return Str::studly($this->argument('name')) . 'Factory.php'; |
|
80 | + return Str::studly($this->argument('name')).'Factory.php'; |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | /** |
@@ -107,6 +107,6 @@ discard block |
||
107 | 107 | { |
108 | 108 | $path = $this->pathNamespace(config('modules.paths.generator.model.path', 'app/Models')); |
109 | 109 | |
110 | - return $this->laravel['modules']->config('namespace') . '\\' . $this->laravel['modules']->findOrFail($this->getModuleName()) . '\\' . $path; |
|
110 | + return $this->laravel['modules']->config('namespace').'\\'.$this->laravel['modules']->findOrFail($this->getModuleName()).'\\'.$path; |
|
111 | 111 | } |
112 | 112 | } |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | /** |
258 | 258 | * Set force status. |
259 | 259 | */ |
260 | - public function setForce(bool|int $force): self |
|
260 | + public function setForce(bool | int $force): self |
|
261 | 261 | { |
262 | 262 | $this->force = $force; |
263 | 263 | |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | continue; |
318 | 318 | } |
319 | 319 | |
320 | - $path = $this->module->getModulePath($this->getName()) . '/' . $folder->getPath(); |
|
320 | + $path = $this->module->getModulePath($this->getName()).'/'.$folder->getPath(); |
|
321 | 321 | |
322 | 322 | $this->filesystem->ensureDirectoryExists($path, 0755, true); |
323 | 323 | if (config('modules.stubs.gitkeep')) { |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | */ |
332 | 332 | public function generateGitKeep(string $path) |
333 | 333 | { |
334 | - $this->filesystem->put($path . '/.gitkeep', ''); |
|
334 | + $this->filesystem->put($path.'/.gitkeep', ''); |
|
335 | 335 | } |
336 | 336 | |
337 | 337 | /** |
@@ -340,9 +340,9 @@ discard block |
||
340 | 340 | public function generateFiles() |
341 | 341 | { |
342 | 342 | foreach ($this->getFiles() as $stub => $file) { |
343 | - $path = $this->module->getModulePath($this->getName()) . $file; |
|
343 | + $path = $this->module->getModulePath($this->getName()).$file; |
|
344 | 344 | |
345 | - $this->component->task("Generating file {$path}", function () use ($stub, $path) { |
|
345 | + $this->component->task("Generating file {$path}", function() use ($stub, $path) { |
|
346 | 346 | if (!$this->filesystem->isDirectory($dir = dirname($path))) { |
347 | 347 | $this->filesystem->makeDirectory($dir, 0775, true); |
348 | 348 | } |
@@ -368,13 +368,13 @@ discard block |
||
368 | 368 | $providerGenerator = GenerateConfigReader::read('provider'); |
369 | 369 | if ($providerGenerator->generate() === true) { |
370 | 370 | $this->console->call('module:make-provider', [ |
371 | - 'name' => $this->getName() . 'ServiceProvider', |
|
371 | + 'name' => $this->getName().'ServiceProvider', |
|
372 | 372 | 'module' => $this->getName(), |
373 | 373 | '--master' => true, |
374 | 374 | ]); |
375 | 375 | } else { |
376 | 376 | // delete register ServiceProvider on module.json |
377 | - $path = $this->module->getModulePath($this->getName()) . DIRECTORY_SEPARATOR . 'module.json'; |
|
377 | + $path = $this->module->getModulePath($this->getName()).DIRECTORY_SEPARATOR.'module.json'; |
|
378 | 378 | $module_file = $this->filesystem->get($path); |
379 | 379 | $this->filesystem->put( |
380 | 380 | $path, |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | $this->filesystem->replaceInFile( |
397 | 397 | '$this->app->register(Route', |
398 | 398 | '// $this->app->register(Route', |
399 | - $this->module->getModulePath($this->getName()) . DIRECTORY_SEPARATOR . $providerGenerator->getPath() . DIRECTORY_SEPARATOR . sprintf('%sServiceProvider.php', $this->getName()) |
|
399 | + $this->module->getModulePath($this->getName()).DIRECTORY_SEPARATOR.$providerGenerator->getPath().DIRECTORY_SEPARATOR.sprintf('%sServiceProvider.php', $this->getName()) |
|
400 | 400 | ); |
401 | 401 | } |
402 | 402 | } |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | if (GenerateConfigReader::read('controller')->generate() === true) { |
405 | 405 | $options = $this->type == 'api' ? ['--api' => true] : []; |
406 | 406 | $this->console->call('module:make-controller', [ |
407 | - 'controller' => $this->getName() . 'Controller', |
|
407 | + 'controller' => $this->getName().'Controller', |
|
408 | 408 | 'module' => $this->getName(), |
409 | 409 | ] + $options); |
410 | 410 | } |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | protected function getStubContents($stub): string |
417 | 417 | { |
418 | 418 | return (new Stub( |
419 | - '/' . $stub . '.stub', |
|
419 | + '/'.$stub.'.stub', |
|
420 | 420 | $this->getReplacement($stub) |
421 | 421 | ) |
422 | 422 | )->render(); |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | } |
453 | 453 | |
454 | 454 | foreach ($keys as $key) { |
455 | - if (method_exists($this, $method = 'get' . ucfirst(Str::studly(strtolower($key))) . 'Replacement')) { |
|
455 | + if (method_exists($this, $method = 'get'.ucfirst(Str::studly(strtolower($key))).'Replacement')) { |
|
456 | 456 | $replaces[$key] = $this->$method(); |
457 | 457 | } else { |
458 | 458 | $replaces[$key] = null; |
@@ -467,9 +467,9 @@ discard block |
||
467 | 467 | */ |
468 | 468 | private function generateModuleJsonFile() |
469 | 469 | { |
470 | - $path = $this->module->getModulePath($this->getName()) . 'module.json'; |
|
470 | + $path = $this->module->getModulePath($this->getName()).'module.json'; |
|
471 | 471 | |
472 | - $this->component->task("Generating file $path", function () use ($path) { |
|
472 | + $this->component->task("Generating file $path", function() use ($path) { |
|
473 | 473 | if (!$this->filesystem->isDirectory($dir = dirname($path))) { |
474 | 474 | $this->filesystem->makeDirectory($dir, 0775, true); |
475 | 475 | } |
@@ -484,13 +484,13 @@ discard block |
||
484 | 484 | */ |
485 | 485 | private function cleanModuleJsonFile() |
486 | 486 | { |
487 | - $path = $this->module->getModulePath($this->getName()) . 'module.json'; |
|
487 | + $path = $this->module->getModulePath($this->getName()).'module.json'; |
|
488 | 488 | |
489 | 489 | $content = $this->filesystem->get($path); |
490 | 490 | $namespace = $this->getModuleNamespaceReplacement(); |
491 | 491 | $studlyName = $this->getStudlyNameReplacement(); |
492 | 492 | |
493 | - $provider = '"' . $namespace . '\\\\' . $studlyName . '\\\\Providers\\\\' . $studlyName . 'ServiceProvider"'; |
|
493 | + $provider = '"'.$namespace.'\\\\'.$studlyName.'\\\\Providers\\\\'.$studlyName.'ServiceProvider"'; |
|
494 | 494 | |
495 | 495 | $content = str_replace($provider, '', $content); |
496 | 496 |