Completed
Push — master ( 126598...f22255 )
by ARCANEDEV
09:12 queued 07:35
created

ClearCommand   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 37
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 7 2
1
<?php namespace Arcanedev\LogViewer\Commands;
2
3
/**
4
 * Class     ClearCommand
5
 *
6
 * @package  Arcanedev\LogViewer\Commands
7
 * @author   ARCANEDEV <[email protected]>
8
 */
9
class ClearCommand extends Command
10
{
11
    /* -----------------------------------------------------------------
12
     |  Properties
13
     | -----------------------------------------------------------------
14
     */
15
16
    /**
17
     * The name and signature of the console command.
18
     *
19
     * @var string
20
     */
21
    protected $signature = 'log-viewer:clear';
22
23
    /**
24
     * The console command description.
25
     *
26
     * @var string
27
     */
28
    protected $description = 'Clear all generated log files';
29
30
    /* -----------------------------------------------------------------
31
     |  Main Methods
32
     | -----------------------------------------------------------------
33
     */
34
35
    /**
36
     * Execute the console command.
37
     */
38 3
    public function handle()
39
    {
40 3
        if ($this->confirm('This will delete all the log files, Do you wish to continue?')) {
41 3
            $this->logViewer->clear();
42 3
            $this->info('Successfully cleared the logs!');
43
        }
44 3
    }
45
}
46