Passed
Pull Request — master (#77)
by Ron
41:51 queued 13:39
created

backupList   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Test Coverage

Coverage 25%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 12
c 1
b 0
f 0
dl 0
loc 43
ccs 3
cts 12
cp 0.25
rs 10
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A handle() 0 12 3
A __construct() 0 3 1
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 = 'tb-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