From be4afcc6c2a42402d4404263c6a5ca901d067dd2 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 24 Nov 2021 08:43:35 -0600 Subject: [PATCH] formatting --- src/Illuminate/Database/Console/PruneCommand.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Illuminate/Database/Console/PruneCommand.php b/src/Illuminate/Database/Console/PruneCommand.php index 4661c7590a4a..8a22535ad7b0 100644 --- a/src/Illuminate/Database/Console/PruneCommand.php +++ b/src/Illuminate/Database/Console/PruneCommand.php @@ -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}'; @@ -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) { @@ -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);