Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Nov 24, 2021
1 parent 779adea commit be4afcc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Illuminate/Database/Console/PruneCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class PruneCommand extends Command
*/
protected $signature = 'model:prune
{--model=* : Class names of the models to be pruned}
{--exclude=* : Class names of the models to be excluded}
{--except=* : Class names of the models to be excluded from pruning}
{--chunk=1000 : The number of models to retrieve per chunk of models to be deleted}
{--pretend : Display the number of prunable records found instead of deleting them}';

Expand Down Expand Up @@ -88,7 +88,7 @@ protected function models()
return collect($models);
}

$exclude = $this->option('exclude');
$except = $this->option('except');

return collect((new Finder)->in(app_path('Models'))->files()->name('*.php'))
->map(function ($model) {
Expand All @@ -99,9 +99,9 @@ protected function models()
['\\', ''],
Str::after($model->getRealPath(), realpath(app_path()).DIRECTORY_SEPARATOR)
);
})->when(! empty($exclude), function ($models) use ($exclude) {
return $models->filter(function ($model) use ($exclude) {
return ! in_array($model, $exclude);
})->when(! empty($except), function ($models) use ($except) {
return $models->reject(function ($model) use ($except) {
return in_array($model, $except);
});
})->filter(function ($model) {
return $this->isPrunable($model);
Expand Down

0 comments on commit be4afcc

Please sign in to comment.