Passed
Push — master ( 9b8fdb...e88b61 )
by Mike
02:53
created

CachePrefixing::getCachePrefix()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 5
nc 2
nop 0
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
1
<?php namespace GeneaLabs\LaravelModelCaching\Traits;
2
3
trait CachePrefixing
4
{
5
    protected function getCachePrefix() : string
6
    {
7
        return "genealabs:laravel-model-caching:"
8
            . $this->getDatabaseConnectionName() . ":"
9
            . (config("laravel-model-caching.cache-prefix")
10
                ? config("laravel-model-caching.cache-prefix", "") . ":"
11
                : "");
12
    }
13
14
    protected function getDatabaseConnectionName() : string
15
    {
16
        return $this->query->connection->getName();
0 ignored issues
show
Bug Best Practice introduced by
The property query does not exist on GeneaLabs\LaravelModelCa...g\Traits\CachePrefixing. Did you maybe forget to declare it?
Loading history...
17
    }
18
}
19