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

RedisTrait   A

Complexity

Total Complexity 24

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 6
Bugs 0 Features 3
Metric Value
wmc 24
c 6
b 0
f 3
lcom 0
cbo 0
dl 0
loc 25
rs 10
ccs 5
cts 5
cp 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setRedis() 0 4 1
A getRedis() 0 4 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