Completed
Push — master ( 247ae6...f93a8c )
by Nicolas
03:59
created

CanClearModulesCache::clearCache()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2.2559

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 0
dl 0
loc 6
ccs 3
cts 5
cp 0.6
crap 2.2559
rs 9.4285
c 0
b 0
f 0
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 49
    public function clearCache()
11
    {
12 49
        if (config('modules.cache.enabled') === true) {
13
            app('cache')->forget(config('modules.cache.key'));
14
        }
15 49
    }
16
}
17