@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | */ |
| 219 | 219 | public function getCached() |
| 220 | 220 | { |
| 221 | - return $this->cache->remember($this->config('cache.key'), $this->config('cache.lifetime'), function () { |
|
| 221 | + return $this->cache->remember($this->config('cache.key'), $this->config('cache.lifetime'), function() { |
|
| 222 | 222 | return $this->toCollection()->toArray(); |
| 223 | 223 | }); |
| 224 | 224 | } |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | { |
| 308 | 308 | $modules = $this->allEnabled(); |
| 309 | 309 | |
| 310 | - uasort($modules, function (Module $a, Module $b) use ($direction) { |
|
| 310 | + uasort($modules, function(Module $a, Module $b) use ($direction) { |
|
| 311 | 311 | if ($a->get('priority') === $b->get('priority')) { |
| 312 | 312 | return 0; |
| 313 | 313 | } |
@@ -436,9 +436,9 @@ discard block |
||
| 436 | 436 | public function getModulePath($module) |
| 437 | 437 | { |
| 438 | 438 | try { |
| 439 | - return $this->findOrFail($module)->getPath() . '/'; |
|
| 439 | + return $this->findOrFail($module)->getPath().'/'; |
|
| 440 | 440 | } catch (ModuleNotFoundException $e) { |
| 441 | - return $this->getPath() . '/' . Str::studly($module) . '/'; |
|
| 441 | + return $this->getPath().'/'.Str::studly($module).'/'; |
|
| 442 | 442 | } |
| 443 | 443 | } |
| 444 | 444 | |
@@ -447,7 +447,7 @@ discard block |
||
| 447 | 447 | */ |
| 448 | 448 | public function assetPath(string $module) : string |
| 449 | 449 | { |
| 450 | - return $this->config('paths.assets') . '/' . $module; |
|
| 450 | + return $this->config('paths.assets').'/'.$module; |
|
| 451 | 451 | } |
| 452 | 452 | |
| 453 | 453 | /** |
@@ -455,7 +455,7 @@ discard block |
||
| 455 | 455 | */ |
| 456 | 456 | public function config(string $key, $default = null) |
| 457 | 457 | { |
| 458 | - return $this->config->get('modules.' . $key, $default); |
|
| 458 | + return $this->config->get('modules.'.$key, $default); |
|
| 459 | 459 | } |
| 460 | 460 | |
| 461 | 461 | /** |
@@ -545,9 +545,9 @@ discard block |
||
| 545 | 545 | } |
| 546 | 546 | list($name, $url) = explode(':', $asset); |
| 547 | 547 | |
| 548 | - $baseUrl = str_replace(public_path() . DIRECTORY_SEPARATOR, '', $this->getAssetsPath()); |
|
| 548 | + $baseUrl = str_replace(public_path().DIRECTORY_SEPARATOR, '', $this->getAssetsPath()); |
|
| 549 | 549 | |
| 550 | - $url = $this->url->asset($baseUrl . "/{$name}/" . $url); |
|
| 550 | + $url = $this->url->asset($baseUrl."/{$name}/".$url); |
|
| 551 | 551 | |
| 552 | 552 | return str_replace(['http://', 'https://'], '//', $url); |
| 553 | 553 | } |
@@ -87,9 +87,9 @@ |
||
| 87 | 87 | { |
| 88 | 88 | $namespace = $this->laravel['modules']->config('namespace'); |
| 89 | 89 | |
| 90 | - $namespace .= '\\' . $module->getStudlyName(); |
|
| 90 | + $namespace .= '\\'.$module->getStudlyName(); |
|
| 91 | 91 | |
| 92 | - $namespace .= '\\' . $this->getDefaultNamespace(); |
|
| 92 | + $namespace .= '\\'.$this->getDefaultNamespace(); |
|
| 93 | 93 | |
| 94 | 94 | $namespace = str_replace('/', '\\', $namespace); |
| 95 | 95 | |
@@ -18,9 +18,9 @@ |
||
| 18 | 18 | // This checks if we are running on a Laravel Vapor managed instance |
| 19 | 19 | // and sets the path to a writable one (services path is not on a writable storage in Vapor). |
| 20 | 20 | if (!is_null(env('VAPOR_MAINTENANCE_MODE', null))) { |
| 21 | - return Str::replaceLast('config.php', $this->getSnakeNamespace() . '_module.php', $this->app->getCachedConfigPath()); |
|
| 21 | + return Str::replaceLast('config.php', $this->getSnakeNamespace().'_module.php', $this->app->getCachedConfigPath()); |
|
| 22 | 22 | } |
| 23 | - return Str::replaceLast('services.php', $this->getSnakeNamespace() . '_module.php', $this->app->getCachedServicesPath()); |
|
| 23 | + return Str::replaceLast('services.php', $this->getSnakeNamespace().'_module.php', $this->app->getCachedServicesPath()); |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | /** |
@@ -336,7 +336,7 @@ discard block |
||
| 336 | 336 | continue; |
| 337 | 337 | } |
| 338 | 338 | |
| 339 | - $path = $this->module->getModulePath($this->getName()) . '/' . $folder->getPath(); |
|
| 339 | + $path = $this->module->getModulePath($this->getName()).'/'.$folder->getPath(); |
|
| 340 | 340 | |
| 341 | 341 | $this->filesystem->makeDirectory($path, 0755, true); |
| 342 | 342 | if (config('modules.stubs.gitkeep')) { |
@@ -352,7 +352,7 @@ discard block |
||
| 352 | 352 | */ |
| 353 | 353 | public function generateGitKeep($path) |
| 354 | 354 | { |
| 355 | - $this->filesystem->put($path . '/.gitkeep', ''); |
|
| 355 | + $this->filesystem->put($path.'/.gitkeep', ''); |
|
| 356 | 356 | } |
| 357 | 357 | |
| 358 | 358 | /** |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | public function generateFiles() |
| 362 | 362 | { |
| 363 | 363 | foreach ($this->getFiles() as $stub => $file) { |
| 364 | - $path = $this->module->getModulePath($this->getName()) . $file; |
|
| 364 | + $path = $this->module->getModulePath($this->getName()).$file; |
|
| 365 | 365 | |
| 366 | 366 | if (!$this->filesystem->isDirectory($dir = dirname($path))) { |
| 367 | 367 | $this->filesystem->makeDirectory($dir, 0775, true); |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | |
| 389 | 389 | if (GenerateConfigReader::read('provider')->generate() === true) { |
| 390 | 390 | $this->console->call('module:make-provider', [ |
| 391 | - 'name' => $this->getBaseName() . 'ServiceProvider', |
|
| 391 | + 'name' => $this->getBaseName().'ServiceProvider', |
|
| 392 | 392 | 'module' => $this->getName(), |
| 393 | 393 | '--master' => true, |
| 394 | 394 | ]); |
@@ -399,11 +399,11 @@ discard block |
||
| 399 | 399 | } |
| 400 | 400 | |
| 401 | 401 | if (GenerateConfigReader::read('controller')->generate() === true) { |
| 402 | - $options = $this->type=='api'?['--api'=>true]:[]; |
|
| 402 | + $options = $this->type == 'api' ? ['--api'=>true] : []; |
|
| 403 | 403 | $this->console->call('module:make-controller', [ |
| 404 | - 'controller' => $this->getBaseName() . 'Controller', |
|
| 404 | + 'controller' => $this->getBaseName().'Controller', |
|
| 405 | 405 | 'module' => $this->getName(), |
| 406 | - ]+$options); |
|
| 406 | + ] + $options); |
|
| 407 | 407 | } |
| 408 | 408 | } |
| 409 | 409 | |
@@ -417,7 +417,7 @@ discard block |
||
| 417 | 417 | protected function getStubContents($stub) |
| 418 | 418 | { |
| 419 | 419 | return (new Stub( |
| 420 | - '/' . $stub . '.stub', |
|
| 420 | + '/'.$stub.'.stub', |
|
| 421 | 421 | $this->getReplacement($stub) |
| 422 | 422 | ) |
| 423 | 423 | )->render(); |
@@ -457,7 +457,7 @@ discard block |
||
| 457 | 457 | } |
| 458 | 458 | |
| 459 | 459 | foreach ($keys as $key) { |
| 460 | - if (method_exists($this, $method = 'get' . ucfirst(Str::studly(strtolower($key))) . 'Replacement')) { |
|
| 460 | + if (method_exists($this, $method = 'get'.ucfirst(Str::studly(strtolower($key))).'Replacement')) { |
|
| 461 | 461 | $replaces[$key] = $this->$method(); |
| 462 | 462 | } else { |
| 463 | 463 | $replaces[$key] = null; |
@@ -472,7 +472,7 @@ discard block |
||
| 472 | 472 | */ |
| 473 | 473 | private function generateModuleJsonFile() |
| 474 | 474 | { |
| 475 | - $path = $this->module->getModulePath($this->getName()) . 'module.json'; |
|
| 475 | + $path = $this->module->getModulePath($this->getName()).'module.json'; |
|
| 476 | 476 | |
| 477 | 477 | if (!$this->filesystem->isDirectory($dir = dirname($path))) { |
| 478 | 478 | $this->filesystem->makeDirectory($dir, 0775, true); |
@@ -489,13 +489,13 @@ discard block |
||
| 489 | 489 | */ |
| 490 | 490 | private function cleanModuleJsonFile() |
| 491 | 491 | { |
| 492 | - $path = $this->module->getModulePath($this->getName()) . 'module.json'; |
|
| 492 | + $path = $this->module->getModulePath($this->getName()).'module.json'; |
|
| 493 | 493 | |
| 494 | 494 | $content = $this->filesystem->get($path); |
| 495 | 495 | $namespace = $this->getModuleNamespaceReplacement(); |
| 496 | 496 | $studlyName = $this->getStudlyNameReplacement(); |
| 497 | 497 | |
| 498 | - $provider = '"' . $namespace . '\\\\' . $studlyName . '\\\\Providers\\\\' . $studlyName . 'ServiceProvider"'; |
|
| 498 | + $provider = '"'.$namespace.'\\\\'.$studlyName.'\\\\Providers\\\\'.$studlyName.'ServiceProvider"'; |
|
| 499 | 499 | |
| 500 | 500 | $content = str_replace($provider, '', $content); |
| 501 | 501 | |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | |
| 69 | 69 | $factoryPath = GenerateConfigReader::read('factory'); |
| 70 | 70 | |
| 71 | - return $path . $factoryPath->getPath() . '/' . $this->getFileName(); |
|
| 71 | + return $path.$factoryPath->getPath().'/'.$this->getFileName(); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | /** |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | private function getFileName() |
| 78 | 78 | { |
| 79 | - return Str::studly($this->argument('name')) . 'Factory.php'; |
|
| 79 | + return Str::studly($this->argument('name')).'Factory.php'; |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | /** |
@@ -111,6 +111,6 @@ discard block |
||
| 111 | 111 | */ |
| 112 | 112 | public function getModelNamespace(): string |
| 113 | 113 | { |
| 114 | - return $this->laravel['modules']->config('namespace') . '\\' . $this->getModule()->getSubModuleOneSlashNamespace() . '\\' . $this->laravel['modules']->config('paths.generator.model.path', 'Entities'); |
|
| 114 | + return $this->laravel['modules']->config('namespace').'\\'.$this->getModule()->getSubModuleOneSlashNamespace().'\\'.$this->laravel['modules']->config('paths.generator.model.path', 'Entities'); |
|
| 115 | 115 | } |
| 116 | 116 | } |