$this->option('dry-run') of type string is incompatible with the type boolean expected by parameter $dryRun of Cesargb\Database\Support...leanResidualAllModels().
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the ignore-type annotation
21
if ((new Morph())->cleanResidualAllModels(/** @scrutinizer ignore-type */ $this->option('dry-run')) === 0) {
Loading history...
22
$this->info("\tIt's already cleaned");
23
}
24
}
25
26
protected function captureEvents()
27
{
28
Event::listen(
29
RelationMorphFromModelWasCleaned::class,
30
function (RelationMorphFromModelWasCleaned $event) {
31
$this->info(sprintf(
32
"\t✔ Clean model %s in the table %s: %d %s.",
33
get_class($event->model),
34
$event->relation->getRelated()->getTable(),
35
$event->numDeleted,
36
$event->dryRun ? 'rows to remove' : 'rows cleaned'