@@ -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 | |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | return $this->readJson(); |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | - return $this->cache->store($this->config->get('modules.cache.driver'))->remember($this->cacheKey, $this->cacheLifetime, function () { |
|
| 186 | + return $this->cache->store($this->config->get('modules.cache.driver'))->remember($this->cacheKey, $this->cacheLifetime, function() { |
|
| 187 | 187 | return $this->readJson(); |
| 188 | 188 | }); |
| 189 | 189 | } |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | */ |
| 198 | 198 | private function config(string $key, $default = null) |
| 199 | 199 | { |
| 200 | - return $this->config->get('modules.activators.file.' . $key, $default); |
|
| 200 | + return $this->config->get('modules.activators.file.'.$key, $default); |
|
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | /** |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | $paths = array_merge($paths, $this->config('scan.paths')); |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | - $paths = array_map(function ($path) { |
|
| 119 | + $paths = array_map(function($path) { |
|
| 120 | 120 | return Str::endsWith($path, '/*') ? $path : Str::finish($path, '/*'); |
| 121 | 121 | }, $paths); |
| 122 | 122 | |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | */ |
| 201 | 201 | public function getCached() |
| 202 | 202 | { |
| 203 | - return $this->cache->store($this->config->get('modules.cache.driver'))->remember($this->config('cache.key'), $this->config('cache.lifetime'), function () { |
|
| 203 | + return $this->cache->store($this->config->get('modules.cache.driver'))->remember($this->config('cache.key'), $this->config('cache.lifetime'), function() { |
|
| 204 | 204 | return $this->toCollection()->toArray(); |
| 205 | 205 | }); |
| 206 | 206 | } |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | { |
| 290 | 290 | $modules = $this->allEnabled(); |
| 291 | 291 | |
| 292 | - uasort($modules, function (Module $a, Module $b) use ($direction) { |
|
| 292 | + uasort($modules, function(Module $a, Module $b) use ($direction) { |
|
| 293 | 293 | if ($a->get('priority') === $b->get('priority')) { |
| 294 | 294 | return 0; |
| 295 | 295 | } |
@@ -418,9 +418,9 @@ discard block |
||
| 418 | 418 | public function getModulePath($module) |
| 419 | 419 | { |
| 420 | 420 | try { |
| 421 | - return $this->findOrFail($module)->getPath() . '/'; |
|
| 421 | + return $this->findOrFail($module)->getPath().'/'; |
|
| 422 | 422 | } catch (ModuleNotFoundException $e) { |
| 423 | - return $this->getPath() . '/' . Str::studly($module) . '/'; |
|
| 423 | + return $this->getPath().'/'.Str::studly($module).'/'; |
|
| 424 | 424 | } |
| 425 | 425 | } |
| 426 | 426 | |
@@ -429,7 +429,7 @@ discard block |
||
| 429 | 429 | */ |
| 430 | 430 | public function assetPath(string $module): string |
| 431 | 431 | { |
| 432 | - return $this->config('paths.assets') . '/' . $module; |
|
| 432 | + return $this->config('paths.assets').'/'.$module; |
|
| 433 | 433 | } |
| 434 | 434 | |
| 435 | 435 | /** |
@@ -437,7 +437,7 @@ discard block |
||
| 437 | 437 | */ |
| 438 | 438 | public function config(string $key, $default = null) |
| 439 | 439 | { |
| 440 | - return $this->config->get('modules.' . $key, $default); |
|
| 440 | + return $this->config->get('modules.'.$key, $default); |
|
| 441 | 441 | } |
| 442 | 442 | |
| 443 | 443 | /** |
@@ -527,9 +527,9 @@ discard block |
||
| 527 | 527 | } |
| 528 | 528 | list($name, $url) = explode(':', $asset); |
| 529 | 529 | |
| 530 | - $baseUrl = str_replace(public_path() . DIRECTORY_SEPARATOR, '', $this->getAssetsPath()); |
|
| 530 | + $baseUrl = str_replace(public_path().DIRECTORY_SEPARATOR, '', $this->getAssetsPath()); |
|
| 531 | 531 | |
| 532 | - $url = $this->url->asset($baseUrl . "/{$name}/" . $url); |
|
| 532 | + $url = $this->url->asset($baseUrl."/{$name}/".$url); |
|
| 533 | 533 | |
| 534 | 534 | return str_replace(['http://', 'https://'], '//', $url); |
| 535 | 535 | } |
@@ -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 | /** |
@@ -111,6 +111,6 @@ discard block |
||
| 111 | 111 | |
| 112 | 112 | $path = str_replace('/', '\\', $path); |
| 113 | 113 | |
| 114 | - return $this->laravel['modules']->config('namespace') . '\\' . $this->laravel['modules']->findOrFail($this->getModuleName()) . '\\' . $path; |
|
| 114 | + return $this->laravel['modules']->config('namespace').'\\'.$this->laravel['modules']->findOrFail($this->getModuleName()).'\\'.$path; |
|
| 115 | 115 | } |
| 116 | 116 | } |
@@ -3,16 +3,16 @@ discard block |
||
| 3 | 3 | use Illuminate\Foundation\Vite; |
| 4 | 4 | use Illuminate\Support\Facades\Vite as ViteFacade; |
| 5 | 5 | |
| 6 | -if (! function_exists('module_path')) { |
|
| 6 | +if (!function_exists('module_path')) { |
|
| 7 | 7 | function module_path($name, $path = '') |
| 8 | 8 | { |
| 9 | 9 | $module = app('modules')->find($name); |
| 10 | 10 | |
| 11 | - return $module->getPath() . ($path ? DIRECTORY_SEPARATOR . $path : $path); |
|
| 11 | + return $module->getPath().($path ? DIRECTORY_SEPARATOR . $path : $path); |
|
| 12 | 12 | } |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | -if (! function_exists('config_path')) { |
|
| 15 | +if (!function_exists('config_path')) { |
|
| 16 | 16 | /** |
| 17 | 17 | * Get the configuration path. |
| 18 | 18 | * |
@@ -21,11 +21,11 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | function config_path($path = '') |
| 23 | 23 | { |
| 24 | - return app()->basePath() . '/config' . ($path ? DIRECTORY_SEPARATOR . $path : $path); |
|
| 24 | + return app()->basePath().'/config'.($path ? DIRECTORY_SEPARATOR . $path : $path); |
|
| 25 | 25 | } |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | -if (! function_exists('public_path')) { |
|
| 28 | +if (!function_exists('public_path')) { |
|
| 29 | 29 | /** |
| 30 | 30 | * Get the path to the public folder. |
| 31 | 31 | * |
@@ -34,11 +34,11 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | function public_path($path = '') |
| 36 | 36 | { |
| 37 | - return app()->make('path.public') . ($path ? DIRECTORY_SEPARATOR . ltrim($path, DIRECTORY_SEPARATOR) : $path); |
|
| 37 | + return app()->make('path.public').($path ? DIRECTORY_SEPARATOR . ltrim($path, DIRECTORY_SEPARATOR) : $path); |
|
| 38 | 38 | } |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | -if (! function_exists('module_vite')) { |
|
| 41 | +if (!function_exists('module_vite')) { |
|
| 42 | 42 | /** |
| 43 | 43 | * support for vite |
| 44 | 44 | */ |
@@ -120,11 +120,11 @@ discard block |
||
| 120 | 120 | */ |
| 121 | 121 | public function decodeContents() |
| 122 | 122 | { |
| 123 | - $attributes = json_decode($this->getContents(), 1); |
|
| 123 | + $attributes = json_decode($this->getContents(), 1); |
|
| 124 | 124 | |
| 125 | 125 | // any JSON parsing errors should throw an exception |
| 126 | 126 | if (json_last_error() > 0) { |
| 127 | - throw new InvalidJsonException('Error processing file: ' . $this->getPath() . '. Error: ' . json_last_error_msg()); |
|
| 127 | + throw new InvalidJsonException('Error processing file: '.$this->getPath().'. Error: '.json_last_error_msg()); |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | return $attributes; |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | return $this->decodeContents(); |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | - return app('cache')->store(config('modules.cache.driver'))->remember($this->getPath(), config('modules.cache.lifetime'), function () { |
|
| 145 | + return app('cache')->store(config('modules.cache.driver'))->remember($this->getPath(), config('modules.cache.lifetime'), function() { |
|
| 146 | 146 | return $this->decodeContents(); |
| 147 | 147 | }); |
| 148 | 148 | } |
@@ -99,9 +99,9 @@ discard block |
||
| 99 | 99 | public function getMigrations($reverse = false) |
| 100 | 100 | { |
| 101 | 101 | if (!empty($this->subpath)) { |
| 102 | - $files = $this->laravel['files']->glob($this->getPath() . '/' . $this->subpath); |
|
| 102 | + $files = $this->laravel['files']->glob($this->getPath().'/'.$this->subpath); |
|
| 103 | 103 | } else { |
| 104 | - $files = $this->laravel['files']->glob($this->getPath() . '/*_*.php'); |
|
| 104 | + $files = $this->laravel['files']->glob($this->getPath().'/*_*.php'); |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | // Once we have the array of files in the directory we will just remove the |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | return []; |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | - $files = array_map(function ($file) { |
|
| 114 | + $files = array_map(function($file) { |
|
| 115 | 115 | return str_replace('.php', '', basename($file)); |
| 116 | 116 | }, $files); |
| 117 | 117 | |
@@ -216,8 +216,8 @@ discard block |
||
| 216 | 216 | |
| 217 | 217 | $class = Str::studly($name); |
| 218 | 218 | |
| 219 | - if (!class_exists($class) && file_exists($this->getPath() . '/' . $file . '.php')) { |
|
| 220 | - return include $this->getPath() . '/' . $file . '.php'; |
|
| 219 | + if (!class_exists($class) && file_exists($this->getPath().'/'.$file.'.php')) { |
|
| 220 | + return include $this->getPath().'/'.$file.'.php'; |
|
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | return new $class(); |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | { |
| 233 | 233 | $path = $this->getPath(); |
| 234 | 234 | foreach ($files as $file) { |
| 235 | - $this->laravel['files']->requireOnce($path . '/' . $file . '.php'); |
|
| 235 | + $this->laravel['files']->requireOnce($path.'/'.$file.'.php'); |
|
| 236 | 236 | } |
| 237 | 237 | } |
| 238 | 238 | |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | |
| 316 | 316 | $result = $query->orderBy('migration', 'desc')->get(); |
| 317 | 317 | |
| 318 | - return collect($result)->map(function ($item) { |
|
| 318 | + return collect($result)->map(function($item) { |
|
| 319 | 319 | return (array) $item; |
| 320 | 320 | })->pluck('migration'); |
| 321 | 321 | } |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | |
| 62 | 62 | $channelPath = GenerateConfigReader::read('channels'); |
| 63 | 63 | |
| 64 | - return $path . $channelPath->getPath() . '/' . $this->getFileName() . '.php'; |
|
| 64 | + return $path.$channelPath->getPath().'/'.$this->getFileName().'.php'; |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | /** |
@@ -73,7 +73,7 @@ |
||
| 73 | 73 | |
| 74 | 74 | $seederPath = GenerateConfigReader::read('seeder'); |
| 75 | 75 | |
| 76 | - return $path . $seederPath->getPath() . '/' . $this->getSeederName() . '.php'; |
|
| 76 | + return $path.$seederPath->getPath().'/'.$this->getSeederName().'.php'; |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | /** |