@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | { |
| 204 | 204 | $lowerName = $this->getLowerName(); |
| 205 | 205 | |
| 206 | - $langPath = $this->getPath() . '/Resources/lang'; |
|
| 206 | + $langPath = $this->getPath().'/Resources/lang'; |
|
| 207 | 207 | |
| 208 | 208 | if (is_dir($langPath)) { |
| 209 | 209 | $this->loadTranslationsFrom($langPath, $lowerName); |
@@ -223,8 +223,8 @@ discard block |
||
| 223 | 223 | $file = 'module.json'; |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | - return Arr::get($this->moduleJson, $file, function () use ($file) { |
|
| 227 | - return $this->moduleJson[$file] = new Json($this->getPath() . '/' . $file, $this->files); |
|
| 226 | + return Arr::get($this->moduleJson, $file, function() use ($file) { |
|
| 227 | + return $this->moduleJson[$file] = new Json($this->getPath().'/'.$file, $this->files); |
|
| 228 | 228 | }); |
| 229 | 229 | } |
| 230 | 230 | |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | */ |
| 278 | 278 | protected function fireEvent($event): void |
| 279 | 279 | { |
| 280 | - $this->app['events']->dispatch(sprintf('modules.%s.' . $event, $this->getLowerName()), [$this]); |
|
| 280 | + $this->app['events']->dispatch(sprintf('modules.%s.'.$event, $this->getLowerName()), [$this]); |
|
| 281 | 281 | } |
| 282 | 282 | /** |
| 283 | 283 | * Register the aliases from this module. |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | protected function registerFiles(): void |
| 303 | 303 | { |
| 304 | 304 | foreach ($this->get('files', []) as $file) { |
| 305 | - include $this->path . '/' . $file; |
|
| 305 | + include $this->path.'/'.$file; |
|
| 306 | 306 | } |
| 307 | 307 | } |
| 308 | 308 | |
@@ -407,7 +407,7 @@ discard block |
||
| 407 | 407 | */ |
| 408 | 408 | public function getExtraPath(string $path): string |
| 409 | 409 | { |
| 410 | - return $this->getPath() . '/' . $path; |
|
| 410 | + return $this->getPath().'/'.$path; |
|
| 411 | 411 | } |
| 412 | 412 | |
| 413 | 413 | /** |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | protected function writeComponentViewTemplate() |
| 51 | 51 | { |
| 52 | - $this->call('module:make-component-view', ['name' => $this->argument('name') , 'module' => $this->argument('module')]); |
|
| 52 | + $this->call('module:make-component-view', ['name' => $this->argument('name'), 'module' => $this->argument('module')]); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | public function getDefaultNamespace(): string |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | 'NAMESPACE' => $this->getClassNamespace($module), |
| 83 | 83 | 'CLASS' => $this->getClass(), |
| 84 | 84 | 'LOWER_NAME' => $module->getLowerName(), |
| 85 | - 'COMPONENT_NAME' => 'components.' . Str::lower($this->argument('name')), |
|
| 85 | + 'COMPONENT_NAME' => 'components.'.Str::lower($this->argument('name')), |
|
| 86 | 86 | ]))->render(); |
| 87 | 87 | } |
| 88 | 88 | |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | $path = $this->laravel['modules']->getModulePath($this->getModuleName()); |
| 95 | 95 | $factoryPath = GenerateConfigReader::read('component-class'); |
| 96 | 96 | |
| 97 | - return $path . $factoryPath->getPath() . '/' . $this->getFileName(); |
|
| 97 | + return $path.$factoryPath->getPath().'/'.$this->getFileName(); |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | /** |
@@ -102,6 +102,6 @@ discard block |
||
| 102 | 102 | */ |
| 103 | 103 | private function getFileName() |
| 104 | 104 | { |
| 105 | - return Str::studly($this->argument('name')) . '.php'; |
|
| 105 | + return Str::studly($this->argument('name')).'.php'; |
|
| 106 | 106 | } |
| 107 | 107 | } |
@@ -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 |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | public function getMigrations($reverse = false) |
| 90 | 90 | { |
| 91 | - $files = $this->laravel['files']->glob($this->getPath() . '/*_*.php'); |
|
| 91 | + $files = $this->laravel['files']->glob($this->getPath().'/*_*.php'); |
|
| 92 | 92 | |
| 93 | 93 | // Once we have the array of files in the directory we will just remove the |
| 94 | 94 | // extension and take the basename of the file which is all we need when |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | return []; |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | - $files = array_map(function ($file) { |
|
| 100 | + $files = array_map(function($file) { |
|
| 101 | 101 | return str_replace('.php', '', basename($file)); |
| 102 | 102 | }, $files); |
| 103 | 103 | |
@@ -202,8 +202,8 @@ discard block |
||
| 202 | 202 | |
| 203 | 203 | $class = Str::studly($name); |
| 204 | 204 | |
| 205 | - if (!class_exists($class) && file_exists($this->getPath() . '/' . $file . '.php')) { |
|
| 206 | - return include $this->getPath() . '/' . $file . '.php'; |
|
| 205 | + if (!class_exists($class) && file_exists($this->getPath().'/'.$file.'.php')) { |
|
| 206 | + return include $this->getPath().'/'.$file.'.php'; |
|
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | return new $class(); |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | { |
| 219 | 219 | $path = $this->getPath(); |
| 220 | 220 | foreach ($files as $file) { |
| 221 | - $this->laravel['files']->requireOnce($path . '/' . $file . '.php'); |
|
| 221 | + $this->laravel['files']->requireOnce($path.'/'.$file.'.php'); |
|
| 222 | 222 | } |
| 223 | 223 | } |
| 224 | 224 | |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | |
| 302 | 302 | $result = $query->orderBy('migration', 'desc')->get(); |
| 303 | 303 | |
| 304 | - return collect($result)->map(function ($item) { |
|
| 304 | + return collect($result)->map(function($item) { |
|
| 305 | 305 | return (array) $item; |
| 306 | 306 | })->pluck('migration'); |
| 307 | 307 | } |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | $paths = array_merge($paths, $this->config('scan.paths')); |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | - return array_map(function ($path) { |
|
| 120 | + return array_map(function($path) { |
|
| 121 | 121 | return Str::endsWith($path, '/*') ? $path : Str::finish($path, '/*'); |
| 122 | 122 | }, $paths); |
| 123 | 123 | } |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | */ |
| 200 | 200 | public function getCached() |
| 201 | 201 | { |
| 202 | - return $this->cache->remember($this->config('cache.key'), $this->config('cache.lifetime'), function () { |
|
| 202 | + return $this->cache->remember($this->config('cache.key'), $this->config('cache.lifetime'), function() { |
|
| 203 | 203 | return $this->toCollection()->toArray(); |
| 204 | 204 | }); |
| 205 | 205 | } |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | { |
| 289 | 289 | $modules = $this->allEnabled(); |
| 290 | 290 | |
| 291 | - uasort($modules, function (Module $a, Module $b) use ($direction) { |
|
| 291 | + uasort($modules, function(Module $a, Module $b) use ($direction) { |
|
| 292 | 292 | if ($a->get('priority') === $b->get('priority')) { |
| 293 | 293 | return 0; |
| 294 | 294 | } |
@@ -417,9 +417,9 @@ discard block |
||
| 417 | 417 | public function getModulePath($module) |
| 418 | 418 | { |
| 419 | 419 | try { |
| 420 | - return $this->findOrFail($module)->getPath() . '/'; |
|
| 420 | + return $this->findOrFail($module)->getPath().'/'; |
|
| 421 | 421 | } catch (ModuleNotFoundException $e) { |
| 422 | - return $this->getPath() . '/' . Str::studly($module) . '/'; |
|
| 422 | + return $this->getPath().'/'.Str::studly($module).'/'; |
|
| 423 | 423 | } |
| 424 | 424 | } |
| 425 | 425 | |
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | */ |
| 429 | 429 | public function assetPath(string $module): string |
| 430 | 430 | { |
| 431 | - return $this->config('paths.assets') . '/' . $module; |
|
| 431 | + return $this->config('paths.assets').'/'.$module; |
|
| 432 | 432 | } |
| 433 | 433 | |
| 434 | 434 | /** |
@@ -436,7 +436,7 @@ discard block |
||
| 436 | 436 | */ |
| 437 | 437 | public function config(string $key, $default = null) |
| 438 | 438 | { |
| 439 | - return $this->config->get('modules.' . $key, $default); |
|
| 439 | + return $this->config->get('modules.'.$key, $default); |
|
| 440 | 440 | } |
| 441 | 441 | |
| 442 | 442 | /** |
@@ -526,9 +526,9 @@ discard block |
||
| 526 | 526 | } |
| 527 | 527 | list($name, $url) = explode(':', $asset); |
| 528 | 528 | |
| 529 | - $baseUrl = str_replace(public_path() . DIRECTORY_SEPARATOR, '', $this->getAssetsPath()); |
|
| 529 | + $baseUrl = str_replace(public_path().DIRECTORY_SEPARATOR, '', $this->getAssetsPath()); |
|
| 530 | 530 | |
| 531 | - $url = $this->url->asset($baseUrl . "/{$name}/" . $url); |
|
| 531 | + $url = $this->url->asset($baseUrl."/{$name}/".$url); |
|
| 532 | 532 | |
| 533 | 533 | return str_replace(['http://', 'https://'], '//', $url); |
| 534 | 534 | } |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | continue; |
| 338 | 338 | } |
| 339 | 339 | |
| 340 | - $path = $this->module->getModulePath($this->getName()) . '/' . $folder->getPath(); |
|
| 340 | + $path = $this->module->getModulePath($this->getName()).'/'.$folder->getPath(); |
|
| 341 | 341 | |
| 342 | 342 | $this->filesystem->makeDirectory($path, 0755, true); |
| 343 | 343 | if (config('modules.stubs.gitkeep')) { |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | */ |
| 354 | 354 | public function generateGitKeep($path) |
| 355 | 355 | { |
| 356 | - $this->filesystem->put($path . '/.gitkeep', ''); |
|
| 356 | + $this->filesystem->put($path.'/.gitkeep', ''); |
|
| 357 | 357 | } |
| 358 | 358 | |
| 359 | 359 | /** |
@@ -362,7 +362,7 @@ discard block |
||
| 362 | 362 | public function generateFiles() |
| 363 | 363 | { |
| 364 | 364 | foreach ($this->getFiles() as $stub => $file) { |
| 365 | - $path = $this->module->getModulePath($this->getName()) . $file; |
|
| 365 | + $path = $this->module->getModulePath($this->getName()).$file; |
|
| 366 | 366 | |
| 367 | 367 | if (!$this->filesystem->isDirectory($dir = dirname($path))) { |
| 368 | 368 | $this->filesystem->makeDirectory($dir, 0775, true); |
@@ -389,7 +389,7 @@ discard block |
||
| 389 | 389 | |
| 390 | 390 | if (GenerateConfigReader::read('provider')->generate() === true) { |
| 391 | 391 | $this->console->call('module:make-provider', [ |
| 392 | - 'name' => $this->getBaseName() . 'ServiceProvider', |
|
| 392 | + 'name' => $this->getBaseName().'ServiceProvider', |
|
| 393 | 393 | 'module' => $this->getName(), |
| 394 | 394 | '--master' => true, |
| 395 | 395 | ]); |
@@ -400,11 +400,11 @@ discard block |
||
| 400 | 400 | } |
| 401 | 401 | |
| 402 | 402 | if (GenerateConfigReader::read('controller')->generate() === true) { |
| 403 | - $options = $this->type=='api' ? ['--api'=>true] : []; |
|
| 403 | + $options = $this->type == 'api' ? ['--api'=>true] : []; |
|
| 404 | 404 | $this->console->call('module:make-controller', [ |
| 405 | - 'controller' => $this->getBaseName() . 'Controller', |
|
| 405 | + 'controller' => $this->getBaseName().'Controller', |
|
| 406 | 406 | 'module' => $this->getName(), |
| 407 | - ]+$options); |
|
| 407 | + ] + $options); |
|
| 408 | 408 | } |
| 409 | 409 | } |
| 410 | 410 | |
@@ -418,7 +418,7 @@ discard block |
||
| 418 | 418 | protected function getStubContents($stub) |
| 419 | 419 | { |
| 420 | 420 | return (new Stub( |
| 421 | - '/' . $stub . '.stub', |
|
| 421 | + '/'.$stub.'.stub', |
|
| 422 | 422 | $this->getReplacement($stub) |
| 423 | 423 | ) |
| 424 | 424 | )->render(); |
@@ -458,7 +458,7 @@ discard block |
||
| 458 | 458 | } |
| 459 | 459 | |
| 460 | 460 | foreach ($keys as $key) { |
| 461 | - if (method_exists($this, $method = 'get' . ucfirst(Str::studly(strtolower($key))) . 'Replacement')) { |
|
| 461 | + if (method_exists($this, $method = 'get'.ucfirst(Str::studly(strtolower($key))).'Replacement')) { |
|
| 462 | 462 | $replaces[$key] = $this->$method(); |
| 463 | 463 | } else { |
| 464 | 464 | $replaces[$key] = null; |
@@ -473,7 +473,7 @@ discard block |
||
| 473 | 473 | */ |
| 474 | 474 | private function generateModuleJsonFile() |
| 475 | 475 | { |
| 476 | - $path = $this->module->getModulePath($this->getName()) . 'module.json'; |
|
| 476 | + $path = $this->module->getModulePath($this->getName()).'module.json'; |
|
| 477 | 477 | |
| 478 | 478 | if (!$this->filesystem->isDirectory($dir = dirname($path))) { |
| 479 | 479 | $this->filesystem->makeDirectory($dir, 0775, true); |
@@ -490,13 +490,13 @@ discard block |
||
| 490 | 490 | */ |
| 491 | 491 | private function cleanModuleJsonFile() |
| 492 | 492 | { |
| 493 | - $path = $this->module->getModulePath($this->getName()) . 'module.json'; |
|
| 493 | + $path = $this->module->getModulePath($this->getName()).'module.json'; |
|
| 494 | 494 | |
| 495 | 495 | $content = $this->filesystem->get($path); |
| 496 | 496 | $namespace = $this->getModuleNamespaceReplacement(); |
| 497 | 497 | $studlyName = $this->getStudlyNameReplacement(); |
| 498 | 498 | |
| 499 | - $provider = '"' . $namespace . '\\\\' . $studlyName . '\\\\Providers\\\\' . $studlyName . 'ServiceProvider"'; |
|
| 499 | + $provider = '"'.$namespace.'\\\\'.$studlyName.'\\\\Providers\\\\'.$studlyName.'ServiceProvider"'; |
|
| 500 | 500 | |
| 501 | 501 | $content = str_replace($provider, '', $content); |
| 502 | 502 | |