Completed
Push — master ( 2f7a99...5fa5de )
by Matze
10:42
created

RedisTrait::getRedis()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 3
Bugs 0 Features 2
Metric Value
c 3
b 0
f 2
dl 0
loc 4
rs 10
ccs 2
cts 2
cp 1
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace BrainExe\Core\Traits;
4
5
use BrainExe\Annotations\Annotations\Inject;
6
use BrainExe\Core\Redis\Predis;
7
8
/**
9
 * @api
10
 */
11
trait RedisTrait
12
{
13
14
    /**
15
     * @var Predis
16
     */
17
    private $redis;
18
19
    /**
20
     * @Inject("@Redis")
21
     * @param Predis $client
22
     */
23 15
    public function setRedis(Predis $client)
24
    {
25 15
        $this->redis = $client;
26 15
    }
27
28
    /**
29
     * @return Predis
30
     */
31 10
    protected function getRedis()
32
    {
33 10
        return $this->redis;
34
    }
35
}
36