@@ -45,7 +45,7 @@ |
||
| 45 | 45 | |
| 46 | 46 | $mailPath = $this->laravel['modules']->config('paths.generator.notifications', 'Notifications'); |
| 47 | 47 | |
| 48 | - return $path . $mailPath . '/' . $this->getFileName() . '.php'; |
|
| 48 | + return $path.$mailPath.'/'.$this->getFileName().'.php'; |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | /** |
@@ -86,11 +86,11 @@ |
||
| 86 | 86 | |
| 87 | 87 | $namespace = $this->laravel['modules']->config('namespace'); |
| 88 | 88 | |
| 89 | - $namespace .= '\\' . $module->getStudlyName(); |
|
| 89 | + $namespace .= '\\'.$module->getStudlyName(); |
|
| 90 | 90 | |
| 91 | - $namespace .= '\\' . $this->getDefaultNamespace(); |
|
| 91 | + $namespace .= '\\'.$this->getDefaultNamespace(); |
|
| 92 | 92 | |
| 93 | - $namespace .= '\\' . $extra; |
|
| 93 | + $namespace .= '\\'.$extra; |
|
| 94 | 94 | |
| 95 | 95 | return trim($namespace, '\\'); |
| 96 | 96 | } |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | |
| 66 | 66 | $mailPath = $this->laravel['modules']->config('paths.generator.emails', 'Emails'); |
| 67 | 67 | |
| 68 | - return $path . $mailPath . '/' . $this->getFileName() . '.php'; |
|
| 68 | + return $path.$mailPath.'/'.$this->getFileName().'.php'; |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | /** |
@@ -123,14 +123,14 @@ |
||
| 123 | 123 | |
| 124 | 124 | // any JSON parsing errors should throw an exception |
| 125 | 125 | if (json_last_error() > 0) { |
| 126 | - throw new InvalidJsonException('Error processing file: ' . $this->getPath() . '. Error: ' . json_last_error_msg()); |
|
| 126 | + throw new InvalidJsonException('Error processing file: '.$this->getPath().'. Error: '.json_last_error_msg()); |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (config('modules.cache.enabled') === false) { |
| 130 | 130 | return $attributes; |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | - return app('cache')->remember($this->getPath(), config('modules.cache.lifetime'), function () use ($attributes) { |
|
| 133 | + return app('cache')->remember($this->getPath(), config('modules.cache.lifetime'), function() use ($attributes) { |
|
| 134 | 134 | return $attributes; |
| 135 | 135 | }); |
| 136 | 136 | } |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | */ |
| 145 | 145 | public function createField($column, $attributes, $type = 'add') |
| 146 | 146 | { |
| 147 | - $results = "\t\t\t" . '$table'; |
|
| 147 | + $results = "\t\t\t".'$table'; |
|
| 148 | 148 | |
| 149 | 149 | foreach ($attributes as $key => $field) { |
| 150 | 150 | if (in_array($column, $this->relationshipKeys)) { |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | } |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | - return $results . ';' . PHP_EOL; |
|
| 157 | + return $results.';'.PHP_EOL; |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | /** |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | */ |
| 169 | 169 | protected function addRelationColumn($key, $field, $column) |
| 170 | 170 | { |
| 171 | - $relatedColumn = snake_case(class_basename($field)) . '_id'; |
|
| 171 | + $relatedColumn = snake_case(class_basename($field)).'_id'; |
|
| 172 | 172 | |
| 173 | 173 | $method = 'integer'; |
| 174 | 174 | |
@@ -187,18 +187,18 @@ discard block |
||
| 187 | 187 | protected function addColumn($key, $field, $column) |
| 188 | 188 | { |
| 189 | 189 | if ($this->hasCustomAttribute($column)) { |
| 190 | - return '->' . $field; |
|
| 190 | + return '->'.$field; |
|
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | if ($key == 0) { |
| 194 | - return '->' . $field . "('" . $column . "')"; |
|
| 194 | + return '->'.$field."('".$column."')"; |
|
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | if (str_contains($field, '(')) { |
| 198 | - return '->' . $field; |
|
| 198 | + return '->'.$field; |
|
| 199 | 199 | } |
| 200 | 200 | |
| 201 | - return '->' . $field . '()'; |
|
| 201 | + return '->'.$field.'()'; |
|
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | /** |
@@ -213,10 +213,10 @@ discard block |
||
| 213 | 213 | protected function removeColumn($key, $field, $column) |
| 214 | 214 | { |
| 215 | 215 | if ($this->hasCustomAttribute($column)) { |
| 216 | - return '->' . $field; |
|
| 216 | + return '->'.$field; |
|
| 217 | 217 | } |
| 218 | 218 | |
| 219 | - return '->dropColumn(' . "'" . $column . "')"; |
|
| 219 | + return '->dropColumn('."'".$column."')"; |
|
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | /** |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | */ |
| 242 | 242 | public function getAttributes($column, $schema) |
| 243 | 243 | { |
| 244 | - $fields = str_replace($column . ':', '', $schema); |
|
| 244 | + $fields = str_replace($column.':', '', $schema); |
|
| 245 | 245 | |
| 246 | 246 | return $this->hasCustomAttribute($column) ? $this->getCustomAttribute($column) : explode(':', $fields); |
| 247 | 247 | } |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | foreach ($this->module->getOrdered($this->option('direction')) as $module) { |
| 50 | - $this->line('Running for module: <info>' . $module->getName() . '</info>'); |
|
| 50 | + $this->line('Running for module: <info>'.$module->getName().'</info>'); |
|
| 51 | 51 | |
| 52 | 52 | $this->migrate($module); |
| 53 | 53 | } |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | $path = str_replace(base_path(), '', (new Migrator($module))->getPath()); |
| 64 | 64 | |
| 65 | 65 | if ($this->option('subpath')) { |
| 66 | - $path = $path . "/" . $this->option("subpath"); |
|
| 66 | + $path = $path."/".$this->option("subpath"); |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | $this->call('migrate', [ |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | public function generateFolders() |
| 277 | 277 | { |
| 278 | 278 | foreach ($this->getFolders() as $folder) { |
| 279 | - $path = $this->module->getModulePath($this->getName()) . '/' . $folder; |
|
| 279 | + $path = $this->module->getModulePath($this->getName()).'/'.$folder; |
|
| 280 | 280 | |
| 281 | 281 | $this->filesystem->makeDirectory($path, 0755, true); |
| 282 | 282 | |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | */ |
| 292 | 292 | public function generateGitKeep($path) |
| 293 | 293 | { |
| 294 | - $this->filesystem->put($path . '/.gitkeep', ''); |
|
| 294 | + $this->filesystem->put($path.'/.gitkeep', ''); |
|
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | /** |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | public function generateFiles() |
| 301 | 301 | { |
| 302 | 302 | foreach ($this->getFiles() as $stub => $file) { |
| 303 | - $path = $this->module->getModulePath($this->getName()) . $file; |
|
| 303 | + $path = $this->module->getModulePath($this->getName()).$file; |
|
| 304 | 304 | |
| 305 | 305 | if (!$this->filesystem->isDirectory($dir = dirname($path))) { |
| 306 | 306 | $this->filesystem->makeDirectory($dir, 0775, true); |
@@ -324,13 +324,13 @@ discard block |
||
| 324 | 324 | ]); |
| 325 | 325 | |
| 326 | 326 | $this->console->call('module:make-provider', [ |
| 327 | - 'name' => $this->getName() . 'ServiceProvider', |
|
| 327 | + 'name' => $this->getName().'ServiceProvider', |
|
| 328 | 328 | 'module' => $this->getName(), |
| 329 | 329 | '--master' => true, |
| 330 | 330 | ]); |
| 331 | 331 | |
| 332 | 332 | $this->console->call('module:make-controller', [ |
| 333 | - 'controller' => $this->getName() . 'Controller', |
|
| 333 | + 'controller' => $this->getName().'Controller', |
|
| 334 | 334 | 'module' => $this->getName(), |
| 335 | 335 | ]); |
| 336 | 336 | } |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | protected function getStubContents($stub) |
| 346 | 346 | { |
| 347 | 347 | return (new Stub( |
| 348 | - '/' . $stub . '.stub', |
|
| 348 | + '/'.$stub.'.stub', |
|
| 349 | 349 | $this->getReplacement($stub)) |
| 350 | 350 | )->render(); |
| 351 | 351 | } |
@@ -378,7 +378,7 @@ discard block |
||
| 378 | 378 | $replaces = []; |
| 379 | 379 | |
| 380 | 380 | foreach ($keys as $key) { |
| 381 | - if (method_exists($this, $method = 'get' . ucfirst(studly_case(strtolower($key))) . 'Replacement')) { |
|
| 381 | + if (method_exists($this, $method = 'get'.ucfirst(studly_case(strtolower($key))).'Replacement')) { |
|
| 382 | 382 | $replaces[$key] = call_user_func([$this, $method]); |
| 383 | 383 | } else { |
| 384 | 384 | $replaces[$key] = null; |
@@ -393,7 +393,7 @@ discard block |
||
| 393 | 393 | */ |
| 394 | 394 | private function generateModuleJsonFile() |
| 395 | 395 | { |
| 396 | - $path = $this->module->getModulePath($this->getName()) . 'module.json'; |
|
| 396 | + $path = $this->module->getModulePath($this->getName()).'module.json'; |
|
| 397 | 397 | |
| 398 | 398 | if (!$this->filesystem->isDirectory($dir = dirname($path))) { |
| 399 | 399 | $this->filesystem->makeDirectory($dir, 0775, true); |
@@ -410,13 +410,13 @@ discard block |
||
| 410 | 410 | */ |
| 411 | 411 | private function cleanModuleJsonFile() |
| 412 | 412 | { |
| 413 | - $path = $this->module->getModulePath($this->getName()) . 'module.json'; |
|
| 413 | + $path = $this->module->getModulePath($this->getName()).'module.json'; |
|
| 414 | 414 | |
| 415 | 415 | $content = $this->filesystem->get($path); |
| 416 | 416 | $namespace = $this->getModuleNamespaceReplacement(); |
| 417 | 417 | $studlyName = $this->getStudlyNameReplacement(); |
| 418 | 418 | |
| 419 | - $provider = '"' . $namespace . '\\\\' . $studlyName . '\\\\Providers\\\\' . $studlyName . 'ServiceProvider"'; |
|
| 419 | + $provider = '"'.$namespace.'\\\\'.$studlyName.'\\\\Providers\\\\'.$studlyName.'ServiceProvider"'; |
|
| 420 | 420 | |
| 421 | 421 | $content = str_replace($provider, '', $content); |
| 422 | 422 | |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | $name = $module->getName(); |
| 92 | 92 | $config = $module->get('migration'); |
| 93 | 93 | if (is_array($config) && array_key_exists('seeds', $config)) { |
| 94 | - foreach ((array)$config['seeds'] as $class) { |
|
| 94 | + foreach ((array) $config['seeds'] as $class) { |
|
| 95 | 95 | if (class_exists($class)) { |
| 96 | 96 | $seeders[] = $class; |
| 97 | 97 | } |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | |
| 145 | 145 | $namespace = $this->laravel['modules']->config('namespace'); |
| 146 | 146 | |
| 147 | - return $namespace . '\\' . $name . '\Database\Seeders\\' . $name . 'DatabaseSeeder'; |
|
| 147 | + return $namespace.'\\'.$name.'\Database\Seeders\\'.$name.'DatabaseSeeder'; |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | /** |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | private function handleOptionalMigrationOption() |
| 73 | 73 | { |
| 74 | 74 | if ($this->option('migration') === true) { |
| 75 | - $migrationName = 'create_' . strtolower($this->argument('model')) . '_table'; |
|
| 75 | + $migrationName = 'create_'.strtolower($this->argument('model')).'_table'; |
|
| 76 | 76 | $this->call('module:make-migration', ['name' => $migrationName, 'module' => $this->argument('module')]); |
| 77 | 77 | } |
| 78 | 78 | } |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | |
| 106 | 106 | $seederPath = $this->laravel['modules']->config('paths.generator.model'); |
| 107 | 107 | |
| 108 | - return $path . $seederPath . '/' . $this->getModelName() . '.php'; |
|
| 108 | + return $path.$seederPath.'/'.$this->getModelName().'.php'; |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | /** |