RedisHandler   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 7
c 1
b 0
f 0
dl 0
loc 33
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getConnection() 0 7 2
1
<?php
2
3
namespace SimpleDIC\Dummy;
4
5
class RedisHandler
6
{
7
8
    /**
9
     * @var Client
10
     */
11
    private $client;
12
13
    /**
14
     * @var string
15
     */
16
    private $dns;
17
18
    /**
19
     * RedisHandler constructor.
20
     *
21
     * @param string $dns
22
     */
23
    public function __construct($dns)
24
    {
25
        $this->dns = $dns;
26
    }
27
28
    /**
29
     * @return Client
30
     */
31
    public function getConnection()
32
    {
33
        if ($this->client === null) {
34
            $this->client = new Client('dummy', '12432');
35
        }
36
37
        return $this->client;
38
    }
39
}
40