@@ -59,7 +59,7 @@ |
||
| 59 | 59 | */ |
| 60 | 60 | protected function generateDirectory($dir, $success, $error): int |
| 61 | 61 | { |
| 62 | - if (! $this->laravel['files']->isDirectory($dir)) { |
|
| 62 | + if (!$this->laravel['files']->isDirectory($dir)) { |
|
| 63 | 63 | $this->laravel['files']->makeDirectory($dir, 0755, true, true); |
| 64 | 64 | |
| 65 | 65 | $this->components->info($success); |
@@ -66,12 +66,12 @@ discard block |
||
| 66 | 66 | { |
| 67 | 67 | if ($this instanceof ConfirmableCommand) { |
| 68 | 68 | if ($this->isProhibited() || |
| 69 | - ! $this->confirmToProceed($this->getConfirmableLabel(), fn () => true)) { |
|
| 69 | + !$this->confirmToProceed($this->getConfirmableLabel(), fn () => true)) { |
|
| 70 | 70 | return 1; |
| 71 | 71 | } |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - if (! is_null($info = $this->getInfo())) { |
|
| 74 | + if (!is_null($info = $this->getInfo())) { |
|
| 75 | 75 | $this->components->info($info); |
| 76 | 76 | } |
| 77 | 77 | |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | return; |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | - if (! empty($input->getArgument('module'))) { |
|
| 97 | + if (!empty($input->getArgument('module'))) { |
|
| 98 | 98 | return; |
| 99 | 99 | } |
| 100 | 100 | |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | { |
| 25 | 25 | $module = $this->getModuleModel($name); |
| 26 | 26 | |
| 27 | - $this->components->task("Updating <fg=cyan;options=bold>{$module->getName()}</> Module", function () use ($module) { |
|
| 27 | + $this->components->task("Updating <fg=cyan;options=bold>{$module->getName()}</> Module", function() use ($module) { |
|
| 28 | 28 | $this->laravel['modules']->update($module); |
| 29 | 29 | }); |
| 30 | 30 | } |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | ? '<fg=red;options=bold>Disabled</>' |
| 36 | 36 | : '<fg=green;options=bold>Enabled</>'; |
| 37 | 37 | |
| 38 | - $this->components->task("Disabling <fg=cyan;options=bold>{$module->getName()}</> Module, old status: $status", function () use ($module) { |
|
| 38 | + $this->components->task("Disabling <fg=cyan;options=bold>{$module->getName()}</> Module, old status: $status", function() use ($module) { |
|
| 39 | 39 | $module->disable(); |
| 40 | 40 | }); |
| 41 | 41 | } |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | |
| 37 | 37 | $directories = $this->getDirectories($module); |
| 38 | 38 | |
| 39 | - if (! $directories) { |
|
| 39 | + if (!$directories) { |
|
| 40 | 40 | return; |
| 41 | 41 | } |
| 42 | 42 | |
@@ -69,12 +69,12 @@ discard block |
||
| 69 | 69 | $directories = []; |
| 70 | 70 | if (is_dir($path)) { |
| 71 | 71 | $directories = $this->laravel['files']->directories($path); |
| 72 | - $directories = array_map(function ($directory) use ($moduleName) { |
|
| 72 | + $directories = array_map(function($directory) use ($moduleName) { |
|
| 73 | 73 | return [ |
| 74 | 74 | 'name' => basename($directory), |
| 75 | 75 | 'module' => $moduleName, |
| 76 | 76 | 'path' => $directory, |
| 77 | - 'files' => array_map(function ($file) { |
|
| 77 | + 'files' => array_map(function($file) { |
|
| 78 | 78 | return basename($file); |
| 79 | 79 | }, \File::glob($directory.DIRECTORY_SEPARATOR.'*')), |
| 80 | 80 | ]; |
@@ -103,12 +103,12 @@ discard block |
||
| 103 | 103 | |
| 104 | 104 | $uniqeLangFiles = $directories->pluck('files')->flatten()->unique()->values(); |
| 105 | 105 | |
| 106 | - $directories->each(function ($directory) use ($uniqeLangFiles, &$missingFilesMessage) { |
|
| 106 | + $directories->each(function($directory) use ($uniqeLangFiles, &$missingFilesMessage) { |
|
| 107 | 107 | |
| 108 | 108 | $missingFiles = $uniqeLangFiles->diff($directory['files']); |
| 109 | 109 | |
| 110 | 110 | if ($missingFiles->count() > 0) { |
| 111 | - $missingFiles->each(function ($missingFile) use ($directory, &$missingFilesMessage) { |
|
| 111 | + $missingFiles->each(function($missingFile) use ($directory, &$missingFilesMessage) { |
|
| 112 | 112 | $missingFilesMessage[$directory['name']][] = " {$directory['module']} - Missing language file: {$directory['name']}/{$missingFile}"; |
| 113 | 113 | }); |
| 114 | 114 | } |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | |
| 118 | 118 | if (count($missingFilesMessage) > 0) { |
| 119 | 119 | |
| 120 | - collect($missingFilesMessage)->each(function ($messages, $langDirectory) { |
|
| 120 | + collect($missingFilesMessage)->each(function($messages, $langDirectory) { |
|
| 121 | 121 | |
| 122 | 122 | $this->components->error("Missing language files in $langDirectory directory"); |
| 123 | 123 | |
@@ -140,16 +140,16 @@ discard block |
||
| 140 | 140 | $langDirectories = $directories->pluck('name'); |
| 141 | 141 | |
| 142 | 142 | $missingKeysMessage = []; |
| 143 | - $directories->each(function ($directory) use ($uniqeLangFiles, $langDirectories, &$missingKeysMessage) { |
|
| 143 | + $directories->each(function($directory) use ($uniqeLangFiles, $langDirectories, &$missingKeysMessage) { |
|
| 144 | 144 | |
| 145 | - $uniqeLangFiles->each(function ($file) use ($directory, $langDirectories, &$missingKeysMessage) { |
|
| 145 | + $uniqeLangFiles->each(function($file) use ($directory, $langDirectories, &$missingKeysMessage) { |
|
| 146 | 146 | $langKeys = $this->getLangKeys($directory['path'].DIRECTORY_SEPARATOR.$file); |
| 147 | 147 | |
| 148 | 148 | if ($langKeys == false) { |
| 149 | 149 | return; |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | - $langDirectories->each(function ($langDirectory) use ($directory, $file, $langKeys, &$missingKeysMessage) { |
|
| 152 | + $langDirectories->each(function($langDirectory) use ($directory, $file, $langKeys, &$missingKeysMessage) { |
|
| 153 | 153 | |
| 154 | 154 | if ($directory['name'] != $langDirectory) { |
| 155 | 155 | |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | $missingKeys = $langKeys->diff($otherLangKeys); |
| 165 | 165 | if ($missingKeys->count() > 0) { |
| 166 | 166 | |
| 167 | - $missingKeys->each(function ($missingKey) use ($directory, $langDirectory, $file, &$missingKeysMessage) { |
|
| 167 | + $missingKeys->each(function($missingKey) use ($directory, $langDirectory, $file, &$missingKeysMessage) { |
|
| 168 | 168 | $missingKeysMessage[$langDirectory][] = " {$directory['module']} - Missing language key: {$langDirectory}/{$file} | key: $missingKey"; |
| 169 | 169 | }); |
| 170 | 170 | |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | |
| 177 | 177 | if (count($missingKeysMessage) > 0) { |
| 178 | 178 | |
| 179 | - collect($missingKeysMessage)->each(function ($messages, $langDirectory) { |
|
| 179 | + collect($missingKeysMessage)->each(function($messages, $langDirectory) { |
|
| 180 | 180 | |
| 181 | 181 | $this->components->error("Missing language keys for directory $langDirectory:"); |
| 182 | 182 | |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | { |
| 25 | 25 | $module = $this->getModuleModel($name); |
| 26 | 26 | |
| 27 | - $this->components->task("Generating for <fg=cyan;options=bold>{$module->getName()}</> Module", function () use ($module) { |
|
| 27 | + $this->components->task("Generating for <fg=cyan;options=bold>{$module->getName()}</> Module", function() use ($module) { |
|
| 28 | 28 | chdir($module->getPath()); |
| 29 | 29 | |
| 30 | 30 | passthru('composer dump -o -n -q'); |
@@ -70,15 +70,15 @@ discard block |
||
| 70 | 70 | */ |
| 71 | 71 | protected function models(): Collection |
| 72 | 72 | { |
| 73 | - if (! empty($models = $this->option('model'))) { |
|
| 74 | - return collect($models)->filter(function ($model) { |
|
| 73 | + if (!empty($models = $this->option('model'))) { |
|
| 74 | + return collect($models)->filter(function($model) { |
|
| 75 | 75 | return class_exists($model); |
| 76 | 76 | })->values(); |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | $except = $this->option('except'); |
| 80 | 80 | |
| 81 | - if (! empty($models) && ! empty($except)) { |
|
| 81 | + if (!empty($models) && !empty($except)) { |
|
| 82 | 82 | throw new InvalidArgumentException('The --models and --except options cannot be combined.'); |
| 83 | 83 | } |
| 84 | 84 | |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | return collect(Finder::create()->in($path)->files()->name('*.php')) |
| 101 | - ->map(function ($model) { |
|
| 101 | + ->map(function($model) { |
|
| 102 | 102 | |
| 103 | 103 | $namespace = config('modules.namespace'); |
| 104 | 104 | |
@@ -108,13 +108,13 @@ discard block |
||
| 108 | 108 | Str::after($model->getRealPath(), realpath(config('modules.paths.modules'))) |
| 109 | 109 | ); |
| 110 | 110 | })->values() |
| 111 | - ->when(! empty($except), function ($models) use ($except) { |
|
| 112 | - return $models->reject(function ($model) use ($except) { |
|
| 111 | + ->when(!empty($except), function($models) use ($except) { |
|
| 112 | + return $models->reject(function($model) use ($except) { |
|
| 113 | 113 | return in_array($model, $except); |
| 114 | 114 | }); |
| 115 | - })->filter(function ($model) { |
|
| 115 | + })->filter(function($model) { |
|
| 116 | 116 | return class_exists($model); |
| 117 | - })->filter(function ($model) { |
|
| 117 | + })->filter(function($model) { |
|
| 118 | 118 | return $this->isPrunable($model); |
| 119 | 119 | })->values(); |
| 120 | 120 | } |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | { |
| 25 | 25 | $module = $this->getModuleModel($name); |
| 26 | 26 | |
| 27 | - $this->components->task("Using <fg=cyan;options=bold>{$module->getName()}</> Module", function () use ($module) { |
|
| 27 | + $this->components->task("Using <fg=cyan;options=bold>{$module->getName()}</> Module", function() use ($module) { |
|
| 28 | 28 | $this->laravel['modules']->setUsed($module); |
| 29 | 29 | }); |
| 30 | 30 | } |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | config('modules.paths.generator.model.path').DIRECTORY_SEPARATOR. |
| 51 | 51 | "$model.php"); |
| 52 | 52 | |
| 53 | - if (! count($modelPath)) { |
|
| 53 | + if (!count($modelPath)) { |
|
| 54 | 54 | return $model; |
| 55 | 55 | } |
| 56 | 56 | |