Completed
Push — master ( d33c24...eca1e1 )
by Nicolas
03:51
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 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