Completed
Push — master ( eca1e1...16b172 )
by Nicolas
13:25
created

CanClearModulesCache   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 75%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 12
rs 10
c 0
b 0
f 0
ccs 3
cts 4
cp 0.75

1 Method

Rating   Name   Duplication   Size   Complexity  
A clearCache() 0 6 2
1
<?php
2
3
namespace Nwidart\Modules\Traits;
4
5
trait CanClearModulesCache
6
{
7
    /**
8
     * Clear the modules cache if it is enabled
9
     */
10 50
    public function clearCache()
11
    {
12 50
        if (config('modules.cache.enabled') === true) {
13
            app('cache')->forget(config('modules.cache.key'));
14
        }
15 50
    }
16
}
17