CanClearComponentsCache::clearCache()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 3
nc 2
nop 0
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