Completed
Pull Request — master (#207)
by
unknown
12:42
created

ClearLogsCommand::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
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
    public function handle()
50
    {
51
        File::cleanDirectory(config('log-viewer.storage-path'));
52
        $this->info('Successfully Cleared');
53
    }
54
55
}
56