ClearCommand::handle()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 12
ccs 0
cts 11
cp 0
rs 10
c 1
b 0
f 0
cc 2
nc 2
nop 0
crap 6
1
<?php namespace Arcanesoft\Foundation\Console;
2
3
/**
4
 * Class     ClearCommand
5
 *
6
 * @package  Arcanesoft\Foundation\Console
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 = 'foundation:clear';
22
23
    /**
24
     * The console command description.
25
     *
26
     * @var string
27
     */
28
    protected $description = 'Remove the compiled class/view files, flush the application cache and remove the route/configuration cache files.';
29
30
    /* -----------------------------------------------------------------
31
     |  Main Methods
32
     | -----------------------------------------------------------------
33
     */
34
35
    /**
36
     * Execute the console command.
37
     */
38
    public function handle()
39
    {
40
        $commands = [
41
            'clear-compiled',
42
            'cache:clear',
43
            'config:clear',
44
            'route:clear',
45
            'view:clear',
46
        ];
47
48
        foreach ($commands as $command) {
49
            $this->call($command);
50
        }
51
    }
52
}
53