Skip to content

Commit 3860900

Browse files
author
riccardodallavia
committed
wip
1 parent a2a6ad6 commit 3860900

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

phpstan.neon.dist

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ parameters:
55
level: 4
66
paths:
77
- src
8-
- config
98
- database
109
tmpDir: build/phpstan
1110
checkOctaneCompatibility: true
1211
checkModelProperties: true
1312
checkMissingIterableValueType: false
14-

src/Commands/PruneFieldsCommand.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use Illuminate\Support\Collection;
88
use Illuminate\Support\Facades\Event;
99
use Illuminate\Support\Str;
10-
use InvalidArgumentException;
1110
use Maize\PrunableFields\Events\ModelsFieldsPruned;
1211
use Maize\PrunableFields\MassPrunableFields;
1312
use Maize\PrunableFields\PrunableFields;
@@ -17,6 +16,7 @@ class PruneFieldsCommand extends Command
1716
{
1817
protected $signature = 'model:prune-fields
1918
{--model=* : Class names of the models to be pruned}
19+
{--except=* : Class names of the models to be excluded from pruning}
2020
{--chunk=1000 : The number of models to retrieve per chunk of models to be pruned}
2121
{--pretend : Display the number of prunable records found instead of pruning them}';
2222

@@ -71,10 +71,6 @@ protected function models(): Collection
7171

7272
$except = $this->option('except');
7373

74-
if (! empty($models) && ! empty($except)) {
75-
throw new InvalidArgumentException('The --models and --except options cannot be combined.');
76-
}
77-
7874
return collect((new Finder())->in($this->getDefaultPath())->files()->name('*.php'))
7975
->map(function ($model) {
8076
$namespace = $this->laravel->getNamespace();
@@ -93,6 +89,11 @@ protected function models(): Collection
9389
->values();
9490
}
9591

92+
protected function getDefaultPath(): string
93+
{
94+
return app_path('Models');
95+
}
96+
9697
protected function isPrunable(string $model): bool
9798
{
9899
$uses = class_uses_recursive($model);

0 commit comments

Comments
 (0)