Completed
Push — master ( 653d49...d07665 )
by Nicolas
04:10
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.0625

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
ccs 3
cts 4
cp 0.75
cc 2
eloc 3
nc 2
nop 0
crap 2.0625
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