for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Spatie\DbSnapshots\Commands\Concerns;
use Spatie\DbSnapshots\Snapshot;
use Spatie\DbSnapshots\SnapshotRepository;
trait AsksForSnapshotName
{
public function askForSnapshotName(): string
$snapShots = app(SnapshotRepository::class)->getAll();
$names = $snapShots->map(function (Snapshot $snapshot) {
return $snapshot->name;
})->values()->toArray();
return $this->choice('Which snapshot?', $names, 0);
choice()
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
ignore-call
return $this->/** @scrutinizer ignore-call */ choice('Which snapshot?', $names, 0);
}