Passed
Push — dev5 ( 1140b1...da16e0 )
by Ron
09:38
created

backupList::handle()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 15

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 0
Metric Value
dl 0
loc 15
ccs 0
cts 10
cp 0
rs 9.7666
c 0
b 0
f 0
cc 3
nc 3
nop 0
crap 12
1
<?php
2
3
namespace App\Console\Commands;
4
5
use Illuminate\Console\Command;
6
use Illuminate\Support\Facades\Storage;
7
8
class backupList extends Command
9
{
10
    protected $signature = 'tb-backup:list';
11
    protected $description = 'List all of the available backups';
12
13 2
    public function __construct()
14
    {
15 2
        parent::__construct();
16 2
    }
17
18
    public function handle()
19
    {
20
        $this->line('Showing all available backups');
21
        $this->line('');
22
        $this->line('Name              Date     Time');
23
        $this->line('-------------------------------------');
24
        $fileList = Storage::disk('backup')->files();
25
        foreach($fileList as $file)
26
        {
27
            if($file != '.gitignore')
28
            {
29
                $this->info($file);
30
            }
31
        }
32
    }
33
}
34