@@ -22,14 +22,14 @@ |
||
| 22 | 22 | { |
| 23 | 23 | $module = $this->getModuleModel($name); |
| 24 | 24 | |
| 25 | - $this->components->task("Generating for <fg=cyan;options=bold>{$module->getName()}</> Module", function () use ($module) { |
|
| 25 | + $this->components->task("Generating for <fg=cyan;options=bold>{$module->getName()}</> Module", function() use ($module) { |
|
| 26 | 26 | chdir($module->getPath()); |
| 27 | 27 | |
| 28 | 28 | passthru('composer dump -o -n -q'); |
| 29 | 29 | }); |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - public function getInfo(): string|null |
|
| 32 | + public function getInfo(): string | null |
|
| 33 | 33 | { |
| 34 | 34 | return 'Generating optimized autoload modules'; |
| 35 | 35 | } |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | $database = $this->option('database'); |
| 34 | 34 | |
| 35 | - if (! empty($database)) { |
|
| 35 | + if (!empty($database)) { |
|
| 36 | 36 | $migrator->setDatabase($database); |
| 37 | 37 | } |
| 38 | 38 | |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | if (count($migrated)) { |
| 42 | 42 | foreach ($migrated as $migration) { |
| 43 | - $this->components->task("Rollback: <info>{$migration}</info>", ); |
|
| 43 | + $this->components->task("Rollback: <info>{$migration}</info>",); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | return; |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - public function getInfo(): string|null |
|
| 53 | + public function getInfo(): string | null |
|
| 54 | 54 | { |
| 55 | 55 | return null; |
| 56 | 56 | } |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | ]); |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - public function getInfo(): string|null |
|
| 41 | + public function getInfo(): string | null |
|
| 42 | 42 | { |
| 43 | 43 | return null; |
| 44 | 44 | } |
@@ -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) { |
@@ -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 'Seeding module ...'; |
| 59 | 59 | } |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | $config = $module->get('migration'); |
| 102 | 102 | |
| 103 | 103 | if (is_array($config) && array_key_exists('seeds', $config)) { |
| 104 | - foreach ((array)$config['seeds'] as $class) { |
|
| 104 | + foreach ((array) $config['seeds'] as $class) { |
|
| 105 | 105 | if (class_exists($class)) { |
| 106 | 106 | $seeders[] = $class; |
| 107 | 107 | } |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | protected function dbSeed($className) |
| 139 | 139 | { |
| 140 | 140 | if ($option = $this->option('class')) { |
| 141 | - $params['--class'] = Str::finish(substr($className, 0, strrpos($className, '\\')), '\\') . $option; |
|
| 141 | + $params['--class'] = Str::finish(substr($className, 0, strrpos($className, '\\')), '\\').$option; |
|
| 142 | 142 | } else { |
| 143 | 143 | $params = ['--class' => $className]; |
| 144 | 144 | } |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | $config = GenerateConfigReader::read('seeder'); |
| 170 | 170 | $seederPath = str_replace('/', '\\', $config->getPath()); |
| 171 | 171 | |
| 172 | - return $namespace . '\\' . $name . '\\' . $seederPath . '\\' . $name . 'DatabaseSeeder'; |
|
| 172 | + return $namespace.'\\'.$name.'\\'.$seederPath.'\\'.$name.'DatabaseSeeder'; |
|
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | /** |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | $foundModules = []; |
| 190 | 190 | foreach ($this->laravel['modules']->config('scan.paths') as $path) { |
| 191 | 191 | $namespace = array_slice(explode('/', $path), -1)[0]; |
| 192 | - $foundModules[] = $namespace . '\\' . $name . '\\' . $seederPath . '\\' . $name . 'DatabaseSeeder'; |
|
| 192 | + $foundModules[] = $namespace.'\\'.$name.'\\'.$seederPath.'\\'.$name.'DatabaseSeeder'; |
|
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | return $foundModules; |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | $database = $this->option('database'); |
| 34 | 34 | |
| 35 | - if (! empty($database)) { |
|
| 35 | + if (!empty($database)) { |
|
| 36 | 36 | $migrator->setDatabase($database); |
| 37 | 37 | } |
| 38 | 38 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | $this->components->warn("Nothing to rollback on module <fg=cyan;options=bold>{$module->getName()}</>"); |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | - public function getInfo(): string|null |
|
| 52 | + public function getInfo(): string | null |
|
| 53 | 53 | { |
| 54 | 54 | return null; |
| 55 | 55 | } |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | $path = str_replace('/', '\\', $path); |
| 74 | 74 | |
| 75 | - return $this->laravel['modules']->config('namespace') . '\\' . $this->laravel['modules']->findOrFail($this->getModuleName()) . '\\' . $path; |
|
| 75 | + return $this->laravel['modules']->config('namespace').'\\'.$this->laravel['modules']->findOrFail($this->getModuleName()).'\\'.$path; |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | /** |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | private function getModelVariable(): string |
| 90 | 90 | { |
| 91 | - return '$' . Str::lower($this->argument('name')); |
|
| 91 | + return '$'.Str::lower($this->argument('name')); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | /** |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | |
| 101 | 101 | $observerPath = GenerateConfigReader::read('observer'); |
| 102 | 102 | |
| 103 | - return $path . $observerPath->getPath() . '/' . $this->getFileName(); |
|
| 103 | + return $path.$observerPath->getPath().'/'.$this->getFileName(); |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | /** |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | */ |
| 109 | 109 | private function getFileName() |
| 110 | 110 | { |
| 111 | - return Str::studly($this->argument('name')) . 'Observer.php'; |
|
| 111 | + return Str::studly($this->argument('name')).'Observer.php'; |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | public function handle(): int |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | $string = ''; |
| 59 | 59 | foreach ($pieces as $i => $piece) { |
| 60 | 60 | if ($i + 1 < count($pieces)) { |
| 61 | - $string .= strtolower($piece) . '_'; |
|
| 61 | + $string .= strtolower($piece).'_'; |
|
| 62 | 62 | } else { |
| 63 | 63 | $string .= Str::plural(strtolower($piece)); |
| 64 | 64 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | private function handleOptionalMigrationOption() |
| 100 | 100 | { |
| 101 | 101 | if ($this->option('migration') === true) { |
| 102 | - $migrationName = 'create_' . $this->createMigrationName() . '_table'; |
|
| 102 | + $migrationName = 'create_'.$this->createMigrationName().'_table'; |
|
| 103 | 103 | $this->call('module:make-migration', ['name' => $migrationName, 'module' => $this->argument('module')]); |
| 104 | 104 | } |
| 105 | 105 | } |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | $modelPath = GenerateConfigReader::read('model'); |
| 134 | 134 | |
| 135 | - return $path . $modelPath->getPath() . '/' . $this->getModelName() . '.php'; |
|
| 135 | + return $path.$modelPath->getPath().'/'.$this->getModelName().'.php'; |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | /** |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | |
| 45 | 45 | $controllerPath = GenerateConfigReader::read('controller'); |
| 46 | 46 | |
| 47 | - return $path . $controllerPath->getPath() . '/' . $this->getControllerName() . '.php'; |
|
| 47 | + return $path.$controllerPath->getPath().'/'.$this->getControllerName().'.php'; |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /** |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | $contents = $this->getTemplateContents(); |
| 44 | 44 | |
| 45 | 45 | try { |
| 46 | - $this->components->task("Generating file {$path}", function () use ($path, $contents) { |
|
| 46 | + $this->components->task("Generating file {$path}", function() use ($path, $contents) { |
|
| 47 | 47 | $overwriteFile = $this->hasOption('force') ? $this->option('force') : false; |
| 48 | 48 | (new FileGenerator($path, $contents))->withFileOverwrite($overwriteFile)->generate(); |
| 49 | 49 | }); |
@@ -92,11 +92,11 @@ discard block |
||
| 92 | 92 | |
| 93 | 93 | $namespace = $this->laravel['modules']->config('namespace'); |
| 94 | 94 | |
| 95 | - $namespace .= '\\' . $module->getStudlyName(); |
|
| 95 | + $namespace .= '\\'.$module->getStudlyName(); |
|
| 96 | 96 | |
| 97 | - $namespace .= '\\' . $this->getDefaultNamespace(); |
|
| 97 | + $namespace .= '\\'.$this->getDefaultNamespace(); |
|
| 98 | 98 | |
| 99 | - $namespace .= '\\' . $extra; |
|
| 99 | + $namespace .= '\\'.$extra; |
|
| 100 | 100 | |
| 101 | 101 | $namespace = str_replace('/', '\\', $namespace); |
| 102 | 102 | |