ClearAssetsCommand   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 47
ccs 0
cts 13
cp 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A fire() 0 5 1
A getArguments() 0 4 1
A getOptions() 0 4 1
1
<?php
2
3
use Illuminate\Console\Command;
4
5
class ClearAssetsCommand extends Command
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
6
{
7
    /**
8
     * The console command name.
9
     *
10
     * @var string
11
     */
12
    protected $name = 'assets:clear';
13
14
    /**
15
     * The console command description.
16
     *
17
     * @var string
18
     */
19
    protected $description = 'Remove generated assets automatically';
20
21
    /**
22
     * Execute the console command.
23
     *
24
     * @return void
25
     */
26
    public function fire()
27
    {
28
        File::deleteDirectory(public_path().'/assets');
29
        $this->info('Assets cleared!');
30
    }
31
32
    /**
33
     * Get the console command arguments.
34
     *
35
     * @return array
36
     */
37
    protected function getArguments()
38
    {
39
        return [];
40
    }
41
42
    /**
43
     * Get the console command options.
44
     *
45
     * @return array
46
     */
47
    protected function getOptions()
48
    {
49
        return [];
50
    }
51
}
52