@@ -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'), |
@@ -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 | |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | */ |
| 88 | 88 | public function config($key) |
| 89 | 89 | { |
| 90 | - return collect($this->getManifest())->flatMap(function ($configuration) use ($key) { |
|
| 90 | + return collect($this->getManifest())->flatMap(function($configuration) use ($key) { |
|
| 91 | 91 | return (array) ($configuration[$key] ?? []); |
| 92 | 92 | })->filter()->all(); |
| 93 | 93 | } |
@@ -99,11 +99,11 @@ discard block |
||
| 99 | 99 | */ |
| 100 | 100 | protected function getManifest() |
| 101 | 101 | { |
| 102 | - if (! is_null($this->manifest)) { |
|
| 102 | + if (!is_null($this->manifest)) { |
|
| 103 | 103 | return $this->manifest; |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | - if (! is_file($this->manifestPath)) { |
|
| 106 | + if (!is_file($this->manifestPath)) { |
|
| 107 | 107 | $this->build(); |
| 108 | 108 | } |
| 109 | 109 | |
@@ -119,12 +119,12 @@ discard block |
||
| 119 | 119 | public function build() |
| 120 | 120 | { |
| 121 | 121 | $providers = $this->paths |
| 122 | - ->flatMap(function ($path) { |
|
| 122 | + ->flatMap(function($path) { |
|
| 123 | 123 | $manifests = $this->files->glob("{$path}/module.json"); |
| 124 | 124 | is_array($manifests) || $manifests = []; |
| 125 | 125 | |
| 126 | 126 | return collect($manifests) |
| 127 | - ->map(function ($manifest) { |
|
| 127 | + ->map(function($manifest) { |
|
| 128 | 128 | return $this->files->json($manifest); |
| 129 | 129 | }); |
| 130 | 130 | }) |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | */ |
| 153 | 153 | protected function write(array $manifest) |
| 154 | 154 | { |
| 155 | - if (! is_writable($dirname = dirname($this->manifestPath))) { |
|
| 155 | + if (!is_writable($dirname = dirname($this->manifestPath))) { |
|
| 156 | 156 | throw new Exception("The {$dirname} directory must be present and writable."); |
| 157 | 157 | } |
| 158 | 158 | $this->files->replace( |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | /** |
| 281 | 281 | * Set force status. |
| 282 | 282 | */ |
| 283 | - public function setForce(bool|int $force): self |
|
| 283 | + public function setForce(bool | int $force): self |
|
| 284 | 284 | { |
| 285 | 285 | $this->force = $force; |
| 286 | 286 | |
@@ -364,8 +364,8 @@ discard block |
||
| 364 | 364 | foreach ($this->getFiles() as $stub => $file) { |
| 365 | 365 | $path = $this->module->getModulePath($this->getName()).$file; |
| 366 | 366 | |
| 367 | - $this->component->task("Generating file {$path}", function () use ($stub, $path) { |
|
| 368 | - if (! $this->filesystem->isDirectory($dir = dirname($path))) { |
|
| 367 | + $this->component->task("Generating file {$path}", function() use ($stub, $path) { |
|
| 368 | + if (!$this->filesystem->isDirectory($dir = dirname($path))) { |
|
| 369 | 369 | $this->filesystem->makeDirectory($dir, 0775, true); |
| 370 | 370 | } |
| 371 | 371 | |
@@ -407,7 +407,7 @@ discard block |
||
| 407 | 407 | $eventGeneratorConfig = GenerateConfigReader::read('event-provider'); |
| 408 | 408 | if ( |
| 409 | 409 | (is_null($eventGeneratorConfig->getPath()) && $providerGenerator->generate()) |
| 410 | - || (! is_null($eventGeneratorConfig->getPath()) && $eventGeneratorConfig->generate()) |
|
| 410 | + || (!is_null($eventGeneratorConfig->getPath()) && $eventGeneratorConfig->generate()) |
|
| 411 | 411 | ) { |
| 412 | 412 | $this->console->call('module:make-event-provider', [ |
| 413 | 413 | 'module' => $this->getName(), |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | $routeGeneratorConfig = GenerateConfigReader::read('route-provider'); |
| 427 | 427 | if ( |
| 428 | 428 | (is_null($routeGeneratorConfig->getPath()) && $providerGenerator->generate()) |
| 429 | - || (! is_null($routeGeneratorConfig->getPath()) && $routeGeneratorConfig->generate()) |
|
| 429 | + || (!is_null($routeGeneratorConfig->getPath()) && $routeGeneratorConfig->generate()) |
|
| 430 | 430 | ) { |
| 431 | 431 | $this->console->call('module:route-provider', [ |
| 432 | 432 | 'module' => $this->getName(), |
@@ -478,11 +478,11 @@ discard block |
||
| 478 | 478 | { |
| 479 | 479 | $replacements = $this->module->config('stubs.replacements'); |
| 480 | 480 | |
| 481 | - if (! isset($replacements['composer']['APP_FOLDER_NAME'])) { |
|
| 481 | + if (!isset($replacements['composer']['APP_FOLDER_NAME'])) { |
|
| 482 | 482 | $replacements['composer'][] = 'APP_FOLDER_NAME'; |
| 483 | 483 | } |
| 484 | 484 | |
| 485 | - if (! isset($replacements[$stub])) { |
|
| 485 | + if (!isset($replacements[$stub])) { |
|
| 486 | 486 | return []; |
| 487 | 487 | } |
| 488 | 488 | |
@@ -513,8 +513,8 @@ discard block |
||
| 513 | 513 | { |
| 514 | 514 | $path = $this->module->getModulePath($this->getName()).'module.json'; |
| 515 | 515 | |
| 516 | - $this->component->task("Generating file $path", function () use ($path) { |
|
| 517 | - if (! $this->filesystem->isDirectory($dir = dirname($path))) { |
|
| 516 | + $this->component->task("Generating file $path", function() use ($path) { |
|
| 517 | + if (!$this->filesystem->isDirectory($dir = dirname($path))) { |
|
| 518 | 518 | $this->filesystem->makeDirectory($dir, 0775, true); |
| 519 | 519 | } |
| 520 | 520 | |
@@ -71,12 +71,12 @@ discard block |
||
| 71 | 71 | { |
| 72 | 72 | if ($this instanceof ConfirmableCommand) { |
| 73 | 73 | if ($this->isProhibited() || |
| 74 | - ! $this->confirmToProceed($this->getConfirmableLabel(), fn () => true)) { |
|
| 74 | + !$this->confirmToProceed($this->getConfirmableLabel(), fn () => true)) { |
|
| 75 | 75 | return 1; |
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | - if (! is_null($info = $this->getInfo())) { |
|
| 79 | + if (!is_null($info = $this->getInfo())) { |
|
| 80 | 80 | $this->components->info($info); |
| 81 | 81 | } |
| 82 | 82 | |
@@ -99,17 +99,17 @@ discard block |
||
| 99 | 99 | return; |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | - if (! empty($input->getArgument('module'))) { |
|
| 102 | + if (!empty($input->getArgument('module'))) { |
|
| 103 | 103 | return; |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | $selected_item = multisearch( |
| 107 | 107 | label: 'Select Modules', |
| 108 | - options: function (string $search_value) use ($modules) { |
|
| 108 | + options: function(string $search_value) use ($modules) { |
|
| 109 | 109 | return collect([ |
| 110 | 110 | self::ALL, |
| 111 | 111 | ...$modules, |
| 112 | - ])->when(strlen($search_value) > 0, function (Collection &$modules) use ($search_value) { |
|
| 112 | + ])->when(strlen($search_value) > 0, function(Collection & $modules) use ($search_value) { |
|
| 113 | 113 | return $modules->filter(fn ($item) => str_contains(strtolower($item), strtolower($search_value))); |
| 114 | 114 | })->values()->toArray(); |
| 115 | 115 | }, |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | $path = $this->app['config']->get('modules.stubs.path') ?? __DIR__.'/Commands/stubs'; |
| 63 | 63 | Stub::setBasePath($path); |
| 64 | 64 | |
| 65 | - $this->app->booted(function ($app) { |
|
| 65 | + $this->app->booted(function($app) { |
|
| 66 | 66 | /** @var RepositoryInterface $moduleRepository */ |
| 67 | 67 | $moduleRepository = $app[RepositoryInterface::class]; |
| 68 | 68 | if ($moduleRepository->config('stubs.enabled') === true) { |
@@ -76,12 +76,12 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | protected function registerServices() |
| 78 | 78 | { |
| 79 | - $this->app->singleton(Contracts\RepositoryInterface::class, function ($app) { |
|
| 79 | + $this->app->singleton(Contracts\RepositoryInterface::class, function($app) { |
|
| 80 | 80 | $path = $app['config']->get('modules.paths.modules'); |
| 81 | 81 | |
| 82 | 82 | return new Laravel\LaravelFileRepository($app, $path); |
| 83 | 83 | }); |
| 84 | - $this->app->singleton(Contracts\ActivatorInterface::class, function ($app) { |
|
| 84 | + $this->app->singleton(Contracts\ActivatorInterface::class, function($app) { |
|
| 85 | 85 | $activator = $app['config']->get('modules.activator'); |
| 86 | 86 | $class = $app['config']->get('modules.activators.'.$activator)['class']; |
| 87 | 87 | |
@@ -96,11 +96,11 @@ discard block |
||
| 96 | 96 | |
| 97 | 97 | protected function registerMigrations(): void |
| 98 | 98 | { |
| 99 | - if (! $this->app['config']->get('modules.auto-discover.migrations', true)) { |
|
| 99 | + if (!$this->app['config']->get('modules.auto-discover.migrations', true)) { |
|
| 100 | 100 | return; |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | - $this->app->resolving(Migrator::class, function (Migrator $migrator) { |
|
| 103 | + $this->app->resolving(Migrator::class, function(Migrator $migrator) { |
|
| 104 | 104 | $path = implode(DIRECTORY_SEPARATOR, [ |
| 105 | 105 | $this->app['config']->get('modules.paths.modules'), |
| 106 | 106 | '*', |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | ]); |
| 110 | 110 | |
| 111 | 111 | collect(glob($path, GLOB_ONLYDIR)) |
| 112 | - ->each(function (string $path) use ($migrator) { |
|
| 112 | + ->each(function(string $path) use ($migrator) { |
|
| 113 | 113 | $migrator->path($path); |
| 114 | 114 | }); |
| 115 | 115 | }); |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | $paths = array_merge($paths, $this->config('scan.paths')); |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | - $paths = array_map(function ($path) { |
|
| 121 | + $paths = array_map(function($path) { |
|
| 122 | 122 | return Str::endsWith($path, '/*') ? $path : Str::finish($path, '/*'); |
| 123 | 123 | }, $paths); |
| 124 | 124 | |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | */ |
| 143 | 143 | public function scan() |
| 144 | 144 | { |
| 145 | - if (! empty(self::$modules) && ! $this->app->runningUnitTests()) { |
|
| 145 | + if (!empty(self::$modules) && !$this->app->runningUnitTests()) { |
|
| 146 | 146 | return self::$modules; |
| 147 | 147 | } |
| 148 | 148 | |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | { |
| 243 | 243 | $modules = $this->allEnabled(); |
| 244 | 244 | |
| 245 | - uasort($modules, function (Module $a, Module $b) use ($direction) { |
|
| 245 | + uasort($modules, function(Module $a, Module $b) use ($direction) { |
|
| 246 | 246 | if ($a->get('priority') === $b->get('priority')) { |
| 247 | 247 | return 0; |
| 248 | 248 | } |
@@ -362,7 +362,7 @@ discard block |
||
| 362 | 362 | } |
| 363 | 363 | |
| 364 | 364 | $path = storage_path('app/modules/modules.used'); |
| 365 | - if (! $this->getFiles()->exists($path)) { |
|
| 365 | + if (!$this->getFiles()->exists($path)) { |
|
| 366 | 366 | $this->getFiles()->put($path, ''); |
| 367 | 367 | } |
| 368 | 368 | |
@@ -454,7 +454,7 @@ discard block |
||
| 454 | 454 | */ |
| 455 | 455 | public function isDisabled(string $name): bool |
| 456 | 456 | { |
| 457 | - return ! $this->isEnabled($name); |
|
| 457 | + return !$this->isEnabled($name); |
|
| 458 | 458 | } |
| 459 | 459 | |
| 460 | 460 | /** |