Passed
Push — dev5 ( eaf296...ac9b51 )
by Ron
07:27
created

backupList::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
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
    /**
11
     * The name and signature of the console command.
12
     *
13
     * @var string
14
     */
15
    protected $signature = 'backup:list';
16
17
    /**
18
     * The console command description.
19
     *
20
     * @var string
21
     */
22
    protected $description = 'List all of the available backups';
23
24
    /**
25
     * Create a new command instance.
26
     *
27
     * @return void
28
     */
29 2
    public function __construct()
30
    {
31 2
        parent::__construct();
32 2
    }
33
34
    /**
35
     * Execute the console command.
36
     *
37
     * @return mixed
38
     */
39
    public function handle()
40
    {
41
        $this->line('Showing all available backups');
42
        $this->line('');
43
        $this->line('Name              Date     Time');
44
        $this->line('-------------------------------------');
45
        $fileList = Storage::disk('backup')->files();
46
        foreach($fileList as $file)
47
        {
48
            if($file != '.gitignore')
49
            {
50
                $this->info($file);
51
            }
52
        }
53
    }
54
}
55