Passed
Pull Request — master (#28)
by Mike
02:21
created

Cachable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A cache() 0 9 2
1
<?php namespace GeneaLabs\LaravelModelCaching\Traits;
2
3
use Illuminate\Cache\TaggableStore;
4
5
trait Cachable
6
{
7
    protected function cache(array $tags = [])
8
    {
9
        $cache = cache();
10
11
        if (is_subclass_of($cache->getStore(), TaggableStore::class)) {
12
            $cache = $cache->tags($tags);
13
        }
14
15
        return $cache;
16
    }
17
}
18