ClearCommand   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 4
Bugs 1 Features 1
Metric Value
wmc 1
c 4
b 1
f 1
lcom 0
cbo 4
dl 0
loc 27
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A fire() 0 10 1
1
<?php
2
3
4
class ClearCommand extends SilverstripeCommand
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...
5
{
6
    /**
7
     * The console command name.
8
     *
9
     * @var string
10
     */
11
    protected $name = 'clear:cache';
12
13
    /**
14
     * The console command description.
15
     *
16
     * @var string
17
     */
18
    protected $description = 'Clear the cache by deleting the files and rebuild the manifest';
19
20
    public function fire()
21
    {
22
        $this->info('Used cache location: ' . TEMP_FOLDER);
23
24
        SS_ClassLoader::instance()->getManifest()->regenerate();
25
        $this->info('regenerated manifest!');
26
27
        ClassInfo::reset_db_cache();
28
        $this->info('resetted db cache!');
29
    }
30
}
31