Issues (9)

src/Commands/Concerns/AsksForSnapshotName.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace Spatie\DbSnapshots\Commands\Concerns;
4
5
use Spatie\DbSnapshots\Snapshot;
6
use Spatie\DbSnapshots\SnapshotRepository;
7
8
trait AsksForSnapshotName
9
{
10
    public function askForSnapshotName(): string
11
    {
12
        $snapShots = app(SnapshotRepository::class)->getAll();
13
14
        $names = $snapShots->map(function (Snapshot $snapshot) {
15
            return $snapshot->name;
16
        })->values()->toArray();
17
18
        return $this->choice('Which snapshot?', $names, 0);
0 ignored issues
show
It seems like choice() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

18
        return $this->/** @scrutinizer ignore-call */ choice('Which snapshot?', $names, 0);
Loading history...
19
    }
20
}
21