Passed
Push — master ( b33b8e...5acb2c )
by Gabriel
04:09
created

CanCache::cacheStore()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 6
ccs 4
cts 4
cp 1
crap 2
rs 10
1
<?php
2
3
namespace Nip\Records\Mapping\MappingManager;
4
5
use DateInterval;
6
use Nip\Cache\Stores\Repository;
7
use Nip\Container\Container;
8
9
/**
10
 * Trait CanCache
11
 * @package Nip\Records\Mapping\MappingManager
12
 */
13
trait CanCache
14
{
15
    use \Nip\Cache\Cacheable\CanCache;
16
17
    /**
18
     * @return mixed
19
     */
20
    protected function generateCacheData()
21
    {
22
        return $this->repository->generateCache();
23
    }
24
25 1
    protected function initFromCache()
26
    {
27 1
        $data = $this->getDataFromCache();
28 1
        $this->repository->initFromCache($data);
29 1
    }
30
31
    /**
32
     * @inheritDoc
33
     */
34 1
    protected function dataCacheKey($key= null)
0 ignored issues
show
Unused Code introduced by
The parameter $key is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

34
    protected function dataCacheKey(/** @scrutinizer ignore-unused */ $key= null)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
35
    {
36 1
        return 'orm.mapping.data';
37
    }
38
}
39