@@ -12,7 +12,7 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | public function getCachedServicesPath(): string |
| 14 | 14 | { |
| 15 | - return Str::replaceLast('services.php', $this->getSnakeName() . '_module.php', $this->app->basePath('storage/app/') . 'services.php'); |
|
| 15 | + return Str::replaceLast('services.php', $this->getSnakeName().'_module.php', $this->app->basePath('storage/app/').'services.php'); |
|
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | /** |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | $paths = array_merge($paths, $this->config('scan.paths')); |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | - $paths = array_map(function ($path) { |
|
| 119 | + $paths = array_map(function($path) { |
|
| 120 | 120 | return Str::endsWith($path, '/*') ? $path : Str::finish($path, '/*'); |
| 121 | 121 | }, $paths); |
| 122 | 122 | |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | */ |
| 201 | 201 | public function getCached() |
| 202 | 202 | { |
| 203 | - return $this->cache->remember($this->config('cache.key'), $this->config('cache.lifetime'), function () { |
|
| 203 | + return $this->cache->remember($this->config('cache.key'), $this->config('cache.lifetime'), function() { |
|
| 204 | 204 | return $this->toCollection()->toArray(); |
| 205 | 205 | }); |
| 206 | 206 | } |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | { |
| 290 | 290 | $modules = $this->allEnabled(); |
| 291 | 291 | |
| 292 | - uasort($modules, function (Module $a, Module $b) use ($direction) { |
|
| 292 | + uasort($modules, function(Module $a, Module $b) use ($direction) { |
|
| 293 | 293 | if ($a->get('order') === $b->get('order')) { |
| 294 | 294 | return 0; |
| 295 | 295 | } |
@@ -418,9 +418,9 @@ discard block |
||
| 418 | 418 | public function getModulePath($module) |
| 419 | 419 | { |
| 420 | 420 | try { |
| 421 | - return $this->findOrFail($module)->getPath() . '/'; |
|
| 421 | + return $this->findOrFail($module)->getPath().'/'; |
|
| 422 | 422 | } catch (ModuleNotFoundException $e) { |
| 423 | - return $this->getPath() . '/' . Str::studly($module) . '/'; |
|
| 423 | + return $this->getPath().'/'.Str::studly($module).'/'; |
|
| 424 | 424 | } |
| 425 | 425 | } |
| 426 | 426 | |
@@ -429,7 +429,7 @@ discard block |
||
| 429 | 429 | */ |
| 430 | 430 | public function assetPath(string $module) : string |
| 431 | 431 | { |
| 432 | - return $this->config('paths.assets') . '/' . $module; |
|
| 432 | + return $this->config('paths.assets').'/'.$module; |
|
| 433 | 433 | } |
| 434 | 434 | |
| 435 | 435 | /** |
@@ -437,7 +437,7 @@ discard block |
||
| 437 | 437 | */ |
| 438 | 438 | public function config(string $key, $default = null) |
| 439 | 439 | { |
| 440 | - return $this->config->get('modules.' . $key, $default); |
|
| 440 | + return $this->config->get('modules.'.$key, $default); |
|
| 441 | 441 | } |
| 442 | 442 | |
| 443 | 443 | /** |
@@ -527,9 +527,9 @@ discard block |
||
| 527 | 527 | } |
| 528 | 528 | list($name, $url) = explode(':', $asset); |
| 529 | 529 | |
| 530 | - $baseUrl = str_replace(public_path() . DIRECTORY_SEPARATOR, '', $this->getAssetsPath()); |
|
| 530 | + $baseUrl = str_replace(public_path().DIRECTORY_SEPARATOR, '', $this->getAssetsPath()); |
|
| 531 | 531 | |
| 532 | - $url = $this->url->asset($baseUrl . "/{$name}/" . $url); |
|
| 532 | + $url = $this->url->asset($baseUrl."/{$name}/".$url); |
|
| 533 | 533 | |
| 534 | 534 | return str_replace(['http://', 'https://'], '//', $url); |
| 535 | 535 | } |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | */ |
| 147 | 147 | public function createField($column, $attributes, $type = 'add') |
| 148 | 148 | { |
| 149 | - $results = "\t\t\t" . '$table'; |
|
| 149 | + $results = "\t\t\t".'$table'; |
|
| 150 | 150 | |
| 151 | 151 | foreach ($attributes as $key => $field) { |
| 152 | 152 | if (in_array($column, $this->relationshipKeys)) { |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | } |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | - return $results . ';' . PHP_EOL; |
|
| 159 | + return $results.';'.PHP_EOL; |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | /** |
@@ -171,9 +171,9 @@ discard block |
||
| 171 | 171 | protected function addRelationColumn($key, $field, $column) |
| 172 | 172 | { |
| 173 | 173 | if ($key === 0) { |
| 174 | - $relatedColumn = Str::snake(class_basename($field)) . '_id'; |
|
| 174 | + $relatedColumn = Str::snake(class_basename($field)).'_id'; |
|
| 175 | 175 | |
| 176 | - return "->integer('{$relatedColumn}')->unsigned();" . PHP_EOL . "\t\t\t" . "\$table->foreign('{$relatedColumn}')"; |
|
| 176 | + return "->integer('{$relatedColumn}')->unsigned();".PHP_EOL."\t\t\t"."\$table->foreign('{$relatedColumn}')"; |
|
| 177 | 177 | } |
| 178 | 178 | if ($key === 1) { |
| 179 | 179 | return "->references('{$field}')"; |
@@ -182,9 +182,9 @@ discard block |
||
| 182 | 182 | return "->on('{$field}')"; |
| 183 | 183 | } |
| 184 | 184 | if (Str::contains($field, '(')) { |
| 185 | - return '->' . $field; |
|
| 185 | + return '->'.$field; |
|
| 186 | 186 | } |
| 187 | - return '->' . $field . '()'; |
|
| 187 | + return '->'.$field.'()'; |
|
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | /** |
@@ -199,18 +199,18 @@ discard block |
||
| 199 | 199 | protected function addColumn($key, $field, $column) |
| 200 | 200 | { |
| 201 | 201 | if ($this->hasCustomAttribute($column)) { |
| 202 | - return '->' . $field; |
|
| 202 | + return '->'.$field; |
|
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | if ($key == 0) { |
| 206 | - return '->' . $field . "('" . $column . "')"; |
|
| 206 | + return '->'.$field."('".$column."')"; |
|
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | if (Str::contains($field, '(')) { |
| 210 | - return '->' . $field; |
|
| 210 | + return '->'.$field; |
|
| 211 | 211 | } |
| 212 | 212 | |
| 213 | - return '->' . $field . '()'; |
|
| 213 | + return '->'.$field.'()'; |
|
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | /** |
@@ -225,10 +225,10 @@ discard block |
||
| 225 | 225 | protected function removeColumn($key, $field, $column) |
| 226 | 226 | { |
| 227 | 227 | if ($this->hasCustomAttribute($column)) { |
| 228 | - return '->' . $field; |
|
| 228 | + return '->'.$field; |
|
| 229 | 229 | } |
| 230 | 230 | |
| 231 | - return '->dropColumn(' . "'" . $column . "')"; |
|
| 231 | + return '->dropColumn('."'".$column."')"; |
|
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | /** |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | */ |
| 254 | 254 | public function getAttributes($column, $schema) |
| 255 | 255 | { |
| 256 | - $fields = str_replace($column . ':', '', $schema); |
|
| 256 | + $fields = str_replace($column.':', '', $schema); |
|
| 257 | 257 | |
| 258 | 258 | return $this->hasCustomAttribute($column) ? $this->getCustomAttribute($column) : explode(':', $fields); |
| 259 | 259 | } |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | $name = $module->getName(); |
| 104 | 104 | $config = $module->get('migration'); |
| 105 | 105 | if (is_array($config) && array_key_exists('seeds', $config)) { |
| 106 | - foreach ((array)$config['seeds'] as $class) { |
|
| 106 | + foreach ((array) $config['seeds'] as $class) { |
|
| 107 | 107 | if (class_exists($class)) { |
| 108 | 108 | $seeders[] = $class; |
| 109 | 109 | } |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | protected function dbSeed($className) |
| 138 | 138 | { |
| 139 | 139 | if ($option = $this->option('class')) { |
| 140 | - $params['--class'] = Str::finish(substr($className, 0, strrpos($className, '\\')), '\\') . $option; |
|
| 140 | + $params['--class'] = Str::finish(substr($className, 0, strrpos($className, '\\')), '\\').$option; |
|
| 141 | 141 | } else { |
| 142 | 142 | $params = ['--class' => $className]; |
| 143 | 143 | } |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | $config = GenerateConfigReader::read('seeder'); |
| 169 | 169 | $seederPath = str_replace('/', '\\', $config->getPath()); |
| 170 | 170 | |
| 171 | - return $namespace . '\\' . $name . '\\' . $seederPath . '\\' . $name . 'DatabaseSeeder'; |
|
| 171 | + return $namespace.'\\'.$name.'\\'.$seederPath.'\\'.$name.'DatabaseSeeder'; |
|
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | /** |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | $foundModules = []; |
| 189 | 189 | foreach ($this->laravel['modules']->config('scan.paths') as $path) { |
| 190 | 190 | $namespace = array_slice(explode('/', $path), -1)[0]; |
| 191 | - $foundModules[] = $namespace . '\\' . $name . '\\' . $seederPath . '\\' . $name . 'DatabaseSeeder'; |
|
| 191 | + $foundModules[] = $namespace.'\\'.$name.'\\'.$seederPath.'\\'.$name.'DatabaseSeeder'; |
|
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | return $foundModules; |