Conditions | 2 |
Paths | 1 |
Total Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
18 | { |
||
19 | return collect($this->disk->allFiles()) |
||
20 | ->filter(function (string $fileName) { |
||
21 | $pathinfo = pathinfo($fileName); |
||
22 | |||
23 | if ($pathinfo['extension'] === 'gz') { |
||
24 | $fileName = $pathinfo['filename']; |
||
25 | } |
||
26 | |||
27 | return pathinfo($fileName, PATHINFO_EXTENSION) === 'sql'; |
||
28 | }) |
||
29 | ->map(function (string $fileName) { |
||
30 | return new Snapshot($this->disk, $fileName); |
||
31 | }) |
||
32 | ->sortByDesc(function (Snapshot $snapshot) { |
||
33 | return $snapshot->createdAt()->toDateTimeString(); |
||
34 | }); |
||
35 | } |
||
36 | |||
37 | public function findByName(string $name) |
||
44 |