@@ -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'), |
@@ -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 | |
@@ -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 | |
@@ -85,11 +85,11 @@ discard block |
||
| 85 | 85 | /** |
| 86 | 86 | * {@inheritDoc} |
| 87 | 87 | */ |
| 88 | - public function hasStatus(Module|string $module, bool $status): bool |
|
| 88 | + public function hasStatus(Module | string $module, bool $status): bool |
|
| 89 | 89 | { |
| 90 | 90 | $name = $module instanceof Module ? $module->getName() : $module; |
| 91 | 91 | |
| 92 | - if (! isset($this->modulesStatuses[$name])) { |
|
| 92 | + if (!isset($this->modulesStatuses[$name])) { |
|
| 93 | 93 | return $status === false; |
| 94 | 94 | } |
| 95 | 95 | |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | */ |
| 119 | 119 | public function delete(Module $module): void |
| 120 | 120 | { |
| 121 | - if (! isset($this->modulesStatuses[$module->getName()])) { |
|
| 121 | + if (!isset($this->modulesStatuses[$module->getName()])) { |
|
| 122 | 122 | return; |
| 123 | 123 | } |
| 124 | 124 | unset($this->modulesStatuses[$module->getName()]); |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | */ |
| 141 | 141 | private function readJson(): array |
| 142 | 142 | { |
| 143 | - if (! $this->files->exists($this->statusesFile)) { |
|
| 143 | + if (!$this->files->exists($this->statusesFile)) { |
|
| 144 | 144 | return []; |
| 145 | 145 | } |
| 146 | 146 | |
@@ -66,7 +66,7 @@ |
||
| 66 | 66 | return [ |
| 67 | 67 | 'model' => fn () => search( |
| 68 | 68 | label: 'Select Model', |
| 69 | - options: function (string $search_value) { |
|
| 69 | + options: function(string $search_value) { |
|
| 70 | 70 | return $this->findModels( |
| 71 | 71 | Str::of($search_value)->wrap('', '*') |
| 72 | 72 | )->toArray(); |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | public function executeAction($name): void |
| 15 | 15 | { |
| 16 | 16 | $module = $this->getModuleModel($name); |
| 17 | - $this->components->task("Deleting <fg=cyan;options=bold>{$module->getName()}</> Module", function () use ($module) { |
|
| 17 | + $this->components->task("Deleting <fg=cyan;options=bold>{$module->getName()}</> Module", function() use ($module) { |
|
| 18 | 18 | $module->delete(); |
| 19 | 19 | }); |
| 20 | 20 | } |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | return 'Warning: Do you want to remove the module?'; |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - public function getConfirmableCallback(): \Closure|bool|null |
|
| 32 | + public function getConfirmableCallback(): \Closure | bool | null |
|
| 33 | 33 | { |
| 34 | 34 | return true; |
| 35 | 35 | } |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | return 'Application In Production'; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - public function getConfirmableCallback(): \Closure|bool|null |
|
| 67 | + public function getConfirmableCallback(): \Closure | bool | null |
|
| 68 | 68 | { |
| 69 | 69 | return null; |
| 70 | 70 | } |
@@ -76,12 +76,12 @@ discard block |
||
| 76 | 76 | { |
| 77 | 77 | if ($this instanceof ConfirmableCommand) { |
| 78 | 78 | if ($this->isProhibited() || |
| 79 | - ! $this->confirmToProceed($this->getConfirmableLabel(), $this->getConfirmableCallback())) { |
|
| 79 | + !$this->confirmToProceed($this->getConfirmableLabel(), $this->getConfirmableCallback())) { |
|
| 80 | 80 | return Command::FAILURE; |
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - if (! is_null($info = $this->getInfo())) { |
|
| 84 | + if (!is_null($info = $this->getInfo())) { |
|
| 85 | 85 | $this->components->info($info); |
| 86 | 86 | } |
| 87 | 87 | |
@@ -104,17 +104,17 @@ discard block |
||
| 104 | 104 | return; |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | - if (! empty($input->getArgument('module'))) { |
|
| 107 | + if (!empty($input->getArgument('module'))) { |
|
| 108 | 108 | return; |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | $selected_item = multisearch( |
| 112 | 112 | label: 'Select Modules', |
| 113 | - options: function (string $search_value) use ($modules) { |
|
| 113 | + options: function(string $search_value) use ($modules) { |
|
| 114 | 114 | return collect([ |
| 115 | 115 | self::ALL, |
| 116 | 116 | ...$modules, |
| 117 | - ])->when(strlen($search_value) > 0, function (Collection &$modules) use ($search_value) { |
|
| 117 | + ])->when(strlen($search_value) > 0, function(Collection & $modules) use ($search_value) { |
|
| 118 | 118 | return $modules->filter(fn ($item) => str_contains(strtolower($item), strtolower($search_value))); |
| 119 | 119 | })->values()->toArray(); |
| 120 | 120 | }, |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | /** |
| 53 | 53 | * Get modules by the given status. |
| 54 | 54 | */ |
| 55 | - public function getByStatus(int|bool $status); |
|
| 55 | + public function getByStatus(int | bool $status); |
|
| 56 | 56 | |
| 57 | 57 | /** |
| 58 | 58 | * Find a specific module. |