CanClearComponentsCache   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 12
rs 10
c 0
b 0
f 0

1 Method

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