RedisHandler::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

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