Completed
Pull Request — master (#207)
by
unknown
05:17
created

ClearLogsCommand   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 5 1
1
<?php namespace Arcanedev\LogViewer\Commands;
2
3
use File;
4
use Arcanedev\LogViewer\Contracts\LogViewer;
5
6
/**
7
 * Class     ClearLogsCommand
8
 *
9
 * @package  Arcanedev\LogViewer\Commands
10
 * @author   ARCANEDEV <[email protected]>
11
 */
12
class ClearLogsCommand extends Command
13
{
14
    /* -----------------------------------------------------------------
15
     |  Properties
16
     | -----------------------------------------------------------------
17
     */
18
19
    /**
20
     * The console command name.
21
     *
22
     * @var string
23
     */
24
    protected $name = 'log-viewer:clear';
25
26
    /**
27
     * The console command description.
28
     *
29
     * @var string
30
     */
31
    protected $description = 'Clear all generated log files';
32
33
    /**
34
     * The name and signature of the console command.
35
     *
36
     * @var string
37
     */
38
    protected $signature = 'log-viewer:clear';
39
40
41
    /* -----------------------------------------------------------------
42
     |  Main Methods
43
     | -----------------------------------------------------------------
44
     */
45
46
    /**
47
     * Execute the console command.
48
     */
49 3
    public function handle()
50
    {
51 3
        File::cleanDirectory(config('log-viewer.storage-path'));
52 3
        $this->info('Successfully Cleared The Logs');
53 3
    }
54
55
}
56