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

CachePrefixing::getDatabaseConnectionName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
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