@@ -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 | |
@@ -96,22 +96,22 @@ discard block |
||
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | return collect(Finder::create()->in($path)->files()->name('*.php')) |
| 99 | - ->map(function ($model) { |
|
| 99 | + ->map(function($model) { |
|
| 100 | 100 | |
| 101 | 101 | $namespace = config('modules.namespace'); |
| 102 | - return $namespace . str_replace( |
|
| 102 | + return $namespace.str_replace( |
|
| 103 | 103 | ['/', '.php'], |
| 104 | 104 | ['\\', ''], |
| 105 | 105 | Str::after($model->getRealPath(), realpath(config('modules.paths.modules'))) |
| 106 | 106 | ); |
| 107 | 107 | })->values() |
| 108 | - ->when(! empty($except), function ($models) use ($except) { |
|
| 109 | - return $models->reject(function ($model) use ($except) { |
|
| 108 | + ->when(!empty($except), function($models) use ($except) { |
|
| 109 | + return $models->reject(function($model) use ($except) { |
|
| 110 | 110 | return in_array($model, $except); |
| 111 | 111 | }); |
| 112 | - })->filter(function ($model) { |
|
| 112 | + })->filter(function($model) { |
|
| 113 | 113 | return class_exists($model); |
| 114 | - })->filter(function ($model) { |
|
| 114 | + })->filter(function($model) { |
|
| 115 | 115 | return $this->isPrunable($model); |
| 116 | 116 | })->values(); |
| 117 | 117 | } |
@@ -87,8 +87,7 @@ |
||
| 87 | 87 | config('modules.paths.modules'), |
| 88 | 88 | config('modules.paths.generator.model.path') |
| 89 | 89 | ); |
| 90 | - } |
|
| 91 | - else { |
|
| 90 | + } else { |
|
| 92 | 91 | $path = sprintf('%s/{%s}/%s', |
| 93 | 92 | config('modules.paths.modules'), |
| 94 | 93 | collect($this->argument('module'))->implode(','), |