Code Duplication    Length = 12-12 lines in 2 locations

src/CleanUpModelsCommand.php 2 locations

@@ 78-89 (lines=12) @@
75
            });
76
    }
77
78
    protected function cleanUp(Collection $cleanableModels)
79
    {
80
        $cleanableModels->each(function (string $modelClass) {
81
82
            $numberOfDeletedRecords = $modelClass::cleanUp($modelClass::query())->delete();
83
84
            event(new ModelWasCleanedUp($modelClass, $numberOfDeletedRecords));
85
86
            $this->info("Deleted {$numberOfDeletedRecords} record(s) from {$modelClass}.");
87
88
        });
89
    }
90
91
    protected function forceCleanUp(Collection $cleanableModels)
92
    {
@@ 91-102 (lines=12) @@
88
        });
89
    }
90
91
    protected function forceCleanUp(Collection $cleanableModels)
92
    {
93
        $cleanableModels->each(function (string $modelClass) {
94
95
            $numberOfDeletedRecords = $modelClass::cleanUp($modelClass::query())->forceDelete();
96
97
            event(new ModelWasCleanedUp($modelClass, $numberOfDeletedRecords));
98
99
            $this->info("Deleted {$numberOfDeletedRecords} record(s) from {$modelClass}.");
100
101
        });
102
    }
103
104
    protected function getAllModelsFromEachDirectory(array $directories) : Collection
105
    {