@@ -54,12 +54,12 @@ |
||
| 54 | 54 | ]; |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - protected function getHelperName(): array|string |
|
| 57 | + protected function getHelperName(): 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->getHelperName()); |
| 65 | 65 | } |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | |
| 34 | 34 | $database = $this->option('database'); |
| 35 | 35 | |
| 36 | - if (! empty($database)) { |
|
| 36 | + if (!empty($database)) { |
|
| 37 | 37 | $migrator->setDatabase($database); |
| 38 | 38 | } |
| 39 | 39 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | { |
| 36 | 36 | $module = $this->getModuleModel($name); |
| 37 | 37 | |
| 38 | - $this->components->task("Seeding <fg=cyan;options=bold>{$module->getName()}</> Module", function () use ($module) { |
|
| 38 | + $this->components->task("Seeding <fg=cyan;options=bold>{$module->getName()}</> Module", function() use ($module) { |
|
| 39 | 39 | try { |
| 40 | 40 | $this->moduleSeed($module); |
| 41 | 41 | } catch (\Error $e) { |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | public function getModuleRepository(): RepositoryInterface |
| 65 | 65 | { |
| 66 | 66 | $modules = $this->laravel['modules']; |
| 67 | - if (! $modules instanceof RepositoryInterface) { |
|
| 67 | + if (!$modules instanceof RepositoryInterface) { |
|
| 68 | 68 | throw new RuntimeException('Module repository not found!'); |
| 69 | 69 | } |
| 70 | 70 | |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | { |
| 26 | 26 | $module = $this->getModuleModel($name); |
| 27 | 27 | |
| 28 | - $this->components->task("Refreshing Migration {$module->getName()} module", function () use ($module) { |
|
| 28 | + $this->components->task("Refreshing Migration {$module->getName()} module", function() use ($module) { |
|
| 29 | 29 | $this->call('module:migrate-reset', [ |
| 30 | 30 | 'module' => $module->getStudlyName(), |
| 31 | 31 | '--database' => $this->option('database'), |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | $paths = array_merge($paths, $this->config('scan.paths')); |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | - $paths = array_map(function ($path) { |
|
| 118 | + $paths = array_map(function($path) { |
|
| 119 | 119 | return Str::endsWith($path, '/*') ? $path : Str::finish($path, '/*'); |
| 120 | 120 | }, $paths); |
| 121 | 121 | |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | */ |
| 164 | 164 | public function all(): array |
| 165 | 165 | { |
| 166 | - if (! $this->config('cache.enabled')) { |
|
| 166 | + if (!$this->config('cache.enabled')) { |
|
| 167 | 167 | return $this->scan(); |
| 168 | 168 | } |
| 169 | 169 | |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | */ |
| 197 | 197 | public function getCached() |
| 198 | 198 | { |
| 199 | - return $this->cache->store($this->config->get('modules.cache.driver'))->remember($this->config('cache.key'), $this->config('cache.lifetime'), function () { |
|
| 199 | + return $this->cache->store($this->config->get('modules.cache.driver'))->remember($this->config('cache.key'), $this->config('cache.lifetime'), function() { |
|
| 200 | 200 | return $this->toCollection()->toArray(); |
| 201 | 201 | }); |
| 202 | 202 | } |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | { |
| 268 | 268 | $modules = $this->allEnabled(); |
| 269 | 269 | |
| 270 | - uasort($modules, function (Module $a, Module $b) use ($direction) { |
|
| 270 | + uasort($modules, function(Module $a, Module $b) use ($direction) { |
|
| 271 | 271 | if ($a->get('priority') === $b->get('priority')) { |
| 272 | 272 | return 0; |
| 273 | 273 | } |
@@ -392,7 +392,7 @@ discard block |
||
| 392 | 392 | } |
| 393 | 393 | |
| 394 | 394 | $path = storage_path('app/modules/modules.used'); |
| 395 | - if (! $this->getFiles()->exists($path)) { |
|
| 395 | + if (!$this->getFiles()->exists($path)) { |
|
| 396 | 396 | $this->getFiles()->put($path, ''); |
| 397 | 397 | } |
| 398 | 398 | |
@@ -482,7 +482,7 @@ discard block |
||
| 482 | 482 | */ |
| 483 | 483 | public function isDisabled(string $name): bool |
| 484 | 484 | { |
| 485 | - return ! $this->isEnabled($name); |
|
| 485 | + return !$this->isEnabled($name); |
|
| 486 | 486 | } |
| 487 | 487 | |
| 488 | 488 | /** |
@@ -42,12 +42,12 @@ |
||
| 42 | 42 | */ |
| 43 | 43 | protected function registerServices() |
| 44 | 44 | { |
| 45 | - $this->app->singleton(Contracts\RepositoryInterface::class, function ($app) { |
|
| 45 | + $this->app->singleton(Contracts\RepositoryInterface::class, function($app) { |
|
| 46 | 46 | $path = $app['config']->get('modules.paths.modules'); |
| 47 | 47 | |
| 48 | 48 | return new Lumen\LumenFileRepository($app, $path); |
| 49 | 49 | }); |
| 50 | - $this->app->singleton(Contracts\ActivatorInterface::class, function ($app) { |
|
| 50 | + $this->app->singleton(Contracts\ActivatorInterface::class, function($app) { |
|
| 51 | 51 | $activator = $app['config']->get('modules.activator'); |
| 52 | 52 | $class = $app['config']->get('modules.activators.'.$activator)['class']; |
| 53 | 53 | |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | $file = 'module.json'; |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | - return Arr::get($this->moduleJson, $file, function () use ($file) { |
|
| 223 | + return Arr::get($this->moduleJson, $file, function() use ($file) { |
|
| 224 | 224 | return $this->moduleJson[$file] = new Json($this->getPath().'/'.$file, $this->files); |
| 225 | 225 | }); |
| 226 | 226 | } |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | */ |
| 330 | 330 | public function isDisabled(): bool |
| 331 | 331 | { |
| 332 | - return ! $this->isEnabled(); |
|
| 332 | + return !$this->isEnabled(); |
|
| 333 | 333 | } |
| 334 | 334 | |
| 335 | 335 | /** |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | { |
| 392 | 392 | return config('modules.register.files', 'register') === 'boot' && |
| 393 | 393 | // force register method if option == boot && app is AsgardCms |
| 394 | - ! class_exists('\Modules\Core\Foundation\AsgardCms'); |
|
| 394 | + !class_exists('\Modules\Core\Foundation\AsgardCms'); |
|
| 395 | 395 | } |
| 396 | 396 | |
| 397 | 397 | private function flushCache(): void |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | |
| 34 | 34 | $database = $this->option('database'); |
| 35 | 35 | |
| 36 | - if (! empty($database)) { |
|
| 36 | + if (!empty($database)) { |
|
| 37 | 37 | $migrator->setDatabase($database); |
| 38 | 38 | } |
| 39 | 39 | |
@@ -407,8 +407,8 @@ discard block |
||
| 407 | 407 | foreach ($this->getFiles() as $stub => $file) { |
| 408 | 408 | $path = $this->module->getModulePath($this->getName()).$file; |
| 409 | 409 | |
| 410 | - $this->component->task("Generating file {$path}", function () use ($stub, $path) { |
|
| 411 | - if (! $this->filesystem->isDirectory($dir = dirname($path))) { |
|
| 410 | + $this->component->task("Generating file {$path}", function() use ($stub, $path) { |
|
| 411 | + if (!$this->filesystem->isDirectory($dir = dirname($path))) { |
|
| 412 | 412 | $this->filesystem->makeDirectory($dir, 0775, true); |
| 413 | 413 | } |
| 414 | 414 | |
@@ -450,7 +450,7 @@ discard block |
||
| 450 | 450 | $eventGeneratorConfig = GenerateConfigReader::read('event-provider'); |
| 451 | 451 | if ( |
| 452 | 452 | (is_null($eventGeneratorConfig->getPath()) && $providerGenerator->generate()) |
| 453 | - || (! is_null($eventGeneratorConfig->getPath()) && $eventGeneratorConfig->generate()) |
|
| 453 | + || (!is_null($eventGeneratorConfig->getPath()) && $eventGeneratorConfig->generate()) |
|
| 454 | 454 | ) { |
| 455 | 455 | $this->console->call('module:make-event-provider', [ |
| 456 | 456 | 'module' => $this->getName(), |
@@ -469,7 +469,7 @@ discard block |
||
| 469 | 469 | $routeGeneratorConfig = GenerateConfigReader::read('route-provider'); |
| 470 | 470 | if ( |
| 471 | 471 | (is_null($routeGeneratorConfig->getPath()) && $providerGenerator->generate()) |
| 472 | - || (! is_null($routeGeneratorConfig->getPath()) && $routeGeneratorConfig->generate()) |
|
| 472 | + || (!is_null($routeGeneratorConfig->getPath()) && $routeGeneratorConfig->generate()) |
|
| 473 | 473 | ) { |
| 474 | 474 | $this->console->call('module:route-provider', [ |
| 475 | 475 | 'module' => $this->getName(), |
@@ -524,11 +524,11 @@ discard block |
||
| 524 | 524 | { |
| 525 | 525 | $replacements = $this->module->config('stubs.replacements'); |
| 526 | 526 | |
| 527 | - if (! isset($replacements['composer']['APP_PATH'])) { |
|
| 527 | + if (!isset($replacements['composer']['APP_PATH'])) { |
|
| 528 | 528 | $replacements['composer'][] = 'APP_PATH'; |
| 529 | 529 | } |
| 530 | 530 | |
| 531 | - if (! isset($replacements[$stub])) { |
|
| 531 | + if (!isset($replacements[$stub])) { |
|
| 532 | 532 | return []; |
| 533 | 533 | } |
| 534 | 534 | |
@@ -654,8 +654,8 @@ discard block |
||
| 654 | 654 | { |
| 655 | 655 | $path = $this->module->getModulePath($this->getName()).'module.json'; |
| 656 | 656 | |
| 657 | - $this->component->task("Generating file $path", function () use ($path) { |
|
| 658 | - if (! $this->filesystem->isDirectory($dir = dirname($path))) { |
|
| 657 | + $this->component->task("Generating file $path", function() use ($path) { |
|
| 658 | + if (!$this->filesystem->isDirectory($dir = dirname($path))) { |
|
| 659 | 659 | $this->filesystem->makeDirectory($dir, 0775, true); |
| 660 | 660 | } |
| 661 | 661 | |