@@ -36,8 +36,8 @@ discard block |
||
| 36 | 36 | */ |
| 37 | 37 | protected function registerNamespaces() |
| 38 | 38 | { |
| 39 | - $configPath = __DIR__ . '/../config/config.php'; |
|
| 40 | - $stubsPath = dirname(__DIR__) . '/src/Commands/stubs'; |
|
| 39 | + $configPath = __DIR__.'/../config/config.php'; |
|
| 40 | + $stubsPath = dirname(__DIR__).'/src/Commands/stubs'; |
|
| 41 | 41 | |
| 42 | 42 | $this->publishes([ |
| 43 | 43 | $configPath => config_path('modules.php'), |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | ], 'stubs'); |
| 49 | 49 | |
| 50 | 50 | $this->publishes([ |
| 51 | - __DIR__ . '/../scripts/vite-module-loader.js' => base_path('vite-module-loader.js'), |
|
| 51 | + __DIR__.'/../scripts/vite-module-loader.js' => base_path('vite-module-loader.js'), |
|
| 52 | 52 | ], 'vite'); |
| 53 | 53 | } |
| 54 | 54 | |
@@ -359,7 +359,7 @@ discard block |
||
| 359 | 359 | continue; |
| 360 | 360 | } |
| 361 | 361 | |
| 362 | - $path = $this->module->getModulePath($this->getName()) . '/' . $folder->getPath(); |
|
| 362 | + $path = $this->module->getModulePath($this->getName()).'/'.$folder->getPath(); |
|
| 363 | 363 | |
| 364 | 364 | $this->filesystem->makeDirectory($path, 0755, true); |
| 365 | 365 | if (config('modules.stubs.gitkeep')) { |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | */ |
| 376 | 376 | public function generateGitKeep($path) |
| 377 | 377 | { |
| 378 | - $this->filesystem->put($path . '/.gitkeep', ''); |
|
| 378 | + $this->filesystem->put($path.'/.gitkeep', ''); |
|
| 379 | 379 | } |
| 380 | 380 | |
| 381 | 381 | /** |
@@ -384,9 +384,9 @@ discard block |
||
| 384 | 384 | public function generateFiles() |
| 385 | 385 | { |
| 386 | 386 | foreach ($this->getFiles() as $stub => $file) { |
| 387 | - $path = $this->module->getModulePath($this->getName()) . $file; |
|
| 387 | + $path = $this->module->getModulePath($this->getName()).$file; |
|
| 388 | 388 | |
| 389 | - $this->component->task("Generating file {$path}", function () use ($stub, $path) { |
|
| 389 | + $this->component->task("Generating file {$path}", function() use ($stub, $path) { |
|
| 390 | 390 | if (!$this->filesystem->isDirectory($dir = dirname($path))) { |
| 391 | 391 | $this->filesystem->makeDirectory($dir, 0775, true); |
| 392 | 392 | } |
@@ -411,7 +411,7 @@ discard block |
||
| 411 | 411 | |
| 412 | 412 | if (GenerateConfigReader::read('provider')->generate() === true) { |
| 413 | 413 | $this->console->call('module:make-provider', [ |
| 414 | - 'name' => $this->getName() . 'ServiceProvider', |
|
| 414 | + 'name' => $this->getName().'ServiceProvider', |
|
| 415 | 415 | 'module' => $this->getName(), |
| 416 | 416 | '--master' => true, |
| 417 | 417 | ]); |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | if (GenerateConfigReader::read('controller')->generate() === true) { |
| 424 | 424 | $options = $this->type == 'api' ? ['--api' => true] : []; |
| 425 | 425 | $this->console->call('module:make-controller', [ |
| 426 | - 'controller' => $this->getName() . 'Controller', |
|
| 426 | + 'controller' => $this->getName().'Controller', |
|
| 427 | 427 | 'module' => $this->getName(), |
| 428 | 428 | ] + $options); |
| 429 | 429 | } |
@@ -439,7 +439,7 @@ discard block |
||
| 439 | 439 | protected function getStubContents($stub) |
| 440 | 440 | { |
| 441 | 441 | return (new Stub( |
| 442 | - '/' . $stub . '.stub', |
|
| 442 | + '/'.$stub.'.stub', |
|
| 443 | 443 | $this->getReplacement($stub) |
| 444 | 444 | ) |
| 445 | 445 | )->render(); |
@@ -478,7 +478,7 @@ discard block |
||
| 478 | 478 | } |
| 479 | 479 | } |
| 480 | 480 | foreach ($keys as $key) { |
| 481 | - if (method_exists($this, $method = 'get' . ucfirst(Str::studly(strtolower($key))) . 'Replacement')) { |
|
| 481 | + if (method_exists($this, $method = 'get'.ucfirst(Str::studly(strtolower($key))).'Replacement')) { |
|
| 482 | 482 | $replaces[$key] = $this->$method(); |
| 483 | 483 | } else { |
| 484 | 484 | $replaces[$key] = null; |
@@ -493,9 +493,9 @@ discard block |
||
| 493 | 493 | */ |
| 494 | 494 | private function generateModuleJsonFile() |
| 495 | 495 | { |
| 496 | - $path = $this->module->getModulePath($this->getName()) . 'module.json'; |
|
| 496 | + $path = $this->module->getModulePath($this->getName()).'module.json'; |
|
| 497 | 497 | |
| 498 | - $this->component->task("Generating file $path", function () use ($path) { |
|
| 498 | + $this->component->task("Generating file $path", function() use ($path) { |
|
| 499 | 499 | if (!$this->filesystem->isDirectory($dir = dirname($path))) { |
| 500 | 500 | $this->filesystem->makeDirectory($dir, 0775, true); |
| 501 | 501 | } |
@@ -510,13 +510,13 @@ discard block |
||
| 510 | 510 | */ |
| 511 | 511 | private function cleanModuleJsonFile() |
| 512 | 512 | { |
| 513 | - $path = $this->module->getModulePath($this->getName()) . 'module.json'; |
|
| 513 | + $path = $this->module->getModulePath($this->getName()).'module.json'; |
|
| 514 | 514 | |
| 515 | 515 | $content = $this->filesystem->get($path); |
| 516 | 516 | $namespace = $this->getModuleNamespaceReplacement(); |
| 517 | 517 | $studlyName = $this->getStudlyNameReplacement(); |
| 518 | 518 | |
| 519 | - $provider = '"' . $namespace . '\\\\' . $studlyName . '\\\\Providers\\\\' . $studlyName . 'ServiceProvider"'; |
|
| 519 | + $provider = '"'.$namespace.'\\\\'.$studlyName.'\\\\Providers\\\\'.$studlyName.'ServiceProvider"'; |
|
| 520 | 520 | |
| 521 | 521 | $content = str_replace($provider, '', $content); |
| 522 | 522 | |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | abstract public function executeAction($name); |
| 42 | 42 | |
| 43 | - public function getInfo(): string|null |
|
| 43 | + public function getInfo(): string | null |
|
| 44 | 44 | { |
| 45 | 45 | return null; |
| 46 | 46 | } |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | public function handle() |
| 52 | 52 | { |
| 53 | - if (! is_null($info = $this->getInfo())) { |
|
| 53 | + if (!is_null($info = $this->getInfo())) { |
|
| 54 | 54 | $this->components->info($info); |
| 55 | 55 | } |
| 56 | 56 | |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | return; |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - if (! empty($input->getArgument('module'))) { |
|
| 74 | + if (!empty($input->getArgument('module'))) { |
|
| 75 | 75 | return; |
| 76 | 76 | } |
| 77 | 77 | |
@@ -24,21 +24,21 @@ discard block |
||
| 24 | 24 | { |
| 25 | 25 | $module = $this->getModuleModel($name); |
| 26 | 26 | |
| 27 | - $this->components->task("Updating Composer.json <fg=cyan;options=bold>{$module->getName()}</> Module", function () use ($module) { |
|
| 27 | + $this->components->task("Updating Composer.json <fg=cyan;options=bold>{$module->getName()}</> Module", function() use ($module) { |
|
| 28 | 28 | |
| 29 | - $composer_path = $module->getPath() . DIRECTORY_SEPARATOR . 'composer.json'; |
|
| 29 | + $composer_path = $module->getPath().DIRECTORY_SEPARATOR.'composer.json'; |
|
| 30 | 30 | |
| 31 | 31 | $composer = json_decode(File::get($composer_path), true); |
| 32 | 32 | |
| 33 | 33 | $autoload = data_get($composer, 'autoload.psr-4'); |
| 34 | 34 | |
| 35 | - if (! $autoload) { |
|
| 35 | + if (!$autoload) { |
|
| 36 | 36 | return; |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | $key_name_with_app = sprintf('Modules\\%s\\App\\', $module->getStudlyName()); |
| 40 | 40 | |
| 41 | - if (! array_key_exists($key_name_with_app, $autoload)) { |
|
| 41 | + if (!array_key_exists($key_name_with_app, $autoload)) { |
|
| 42 | 42 | return; |
| 43 | 43 | } |
| 44 | 44 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | }); |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - public function getInfo(): string|null |
|
| 56 | + public function getInfo(): string | null |
|
| 57 | 57 | { |
| 58 | 58 | return 'Updating Composer.json of modules...'; |
| 59 | 59 | } |
@@ -22,12 +22,12 @@ |
||
| 22 | 22 | { |
| 23 | 23 | $module = $this->getModuleModel($name); |
| 24 | 24 | |
| 25 | - $this->components->task("Updating <fg=cyan;options=bold>{$module->getName()}</> Module", function () use ($module) { |
|
| 25 | + $this->components->task("Updating <fg=cyan;options=bold>{$module->getName()}</> Module", function() use ($module) { |
|
| 26 | 26 | $this->laravel['modules']->update($module); |
| 27 | 27 | }); |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - public function getInfo(): string|null |
|
| 30 | + public function getInfo(): string | null |
|
| 31 | 31 | { |
| 32 | 32 | return 'Updating Module ...'; |
| 33 | 33 | } |
@@ -33,12 +33,12 @@ |
||
| 33 | 33 | ? '<fg=red;options=bold>Disabled</>' |
| 34 | 34 | : '<fg=green;options=bold>Enabled</>'; |
| 35 | 35 | |
| 36 | - $this->components->task("Disabling <fg=cyan;options=bold>{$module->getName()}</> Module, old status: $status", function () use ($module) { |
|
| 36 | + $this->components->task("Disabling <fg=cyan;options=bold>{$module->getName()}</> Module, old status: $status", function() use ($module) { |
|
| 37 | 37 | $module->disable(); |
| 38 | 38 | }); |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - public function getInfo(): string|null |
|
| 41 | + public function getInfo(): string | null |
|
| 42 | 42 | { |
| 43 | 43 | return 'Disabling module ...'; |
| 44 | 44 | } |
@@ -22,12 +22,12 @@ |
||
| 22 | 22 | { |
| 23 | 23 | $module = $this->getModuleModel($name); |
| 24 | 24 | |
| 25 | - $this->components->task("Using <fg=cyan;options=bold>{$module->getName()}</> Module", function () use ($module) { |
|
| 25 | + $this->components->task("Using <fg=cyan;options=bold>{$module->getName()}</> Module", function() use ($module) { |
|
| 26 | 26 | $this->laravel['modules']->setUsed($module); |
| 27 | 27 | }); |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - public function getInfo(): string|null |
|
| 30 | + public function getInfo(): string | null |
|
| 31 | 31 | { |
| 32 | 32 | return 'Using Module ...'; |
| 33 | 33 | } |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | { |
| 28 | 28 | parent::__construct(); |
| 29 | 29 | |
| 30 | - $this->langPath = DIRECTORY_SEPARATOR . config('modules.paths.generator.lang.path', 'Resources/lang'); |
|
| 30 | + $this->langPath = DIRECTORY_SEPARATOR.config('modules.paths.generator.lang.path', 'Resources/lang'); |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | public function executeAction($name): void |
@@ -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 | |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | - public function getInfo(): string|null |
|
| 49 | + public function getInfo(): string | null |
|
| 50 | 50 | { |
| 51 | 51 | return 'Checking languages ...'; |
| 52 | 52 | } |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | private function getLangFiles($module) |
| 55 | 55 | { |
| 56 | 56 | $files = []; |
| 57 | - $path = $module->getPath() . $this->langPath; |
|
| 57 | + $path = $module->getPath().$this->langPath; |
|
| 58 | 58 | if (is_dir($path)) { |
| 59 | 59 | $files = array_merge($files, $this->laravel['files']->all($path)); |
| 60 | 60 | } |
@@ -65,18 +65,18 @@ discard block |
||
| 65 | 65 | private function getDirectories($module) |
| 66 | 66 | { |
| 67 | 67 | $moduleName = $module->getStudlyName(); |
| 68 | - $path = $module->getPath() . $this->langPath; |
|
| 68 | + $path = $module->getPath().$this->langPath; |
|
| 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 | - }, \File::glob($directory . DIRECTORY_SEPARATOR . "*")), |
|
| 79 | + }, \File::glob($directory.DIRECTORY_SEPARATOR."*")), |
|
| 80 | 80 | ]; |
| 81 | 81 | }, $directories); |
| 82 | 82 | } |
@@ -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,22 +140,22 @@ 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) { |
|
| 146 | - $langKeys = $this->getLangKeys($directory['path'] . DIRECTORY_SEPARATOR . $file); |
|
| 145 | + $uniqeLangFiles->each(function($file) use ($directory, $langDirectories, &$missingKeysMessage) { |
|
| 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 | |
| 156 | 156 | $basePath = str_replace($directory['name'], $langDirectory, $directory['path']); |
| 157 | 157 | |
| 158 | - $otherLangKeys = $this->getLangKeys($basePath . DIRECTORY_SEPARATOR . $file); |
|
| 158 | + $otherLangKeys = $this->getLangKeys($basePath.DIRECTORY_SEPARATOR.$file); |
|
| 159 | 159 | |
| 160 | 160 | if ($otherLangKeys == false) { |
| 161 | 161 | return; |
@@ -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,12 +24,12 @@ |
||
| 24 | 24 | { |
| 25 | 25 | $module = $this->getModuleModel($name); |
| 26 | 26 | |
| 27 | - $this->components->task("Forget Using <fg=cyan;options=bold>{$module->getName()}</> Module", function () use ($module) { |
|
| 27 | + $this->components->task("Forget Using <fg=cyan;options=bold>{$module->getName()}</> Module", function() use ($module) { |
|
| 28 | 28 | $this->laravel['modules']->forgetUsed($module); |
| 29 | 29 | }); |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - public function getInfo(): string|null |
|
| 32 | + public function getInfo(): string | null |
|
| 33 | 33 | { |
| 34 | 34 | return 'Forget Using Module ...'; |
| 35 | 35 | } |