Passed
Push — v7 ( 8c8f4f...b7a561 )
by Georges
01:55
created

Config::getPassword()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Geolim4
5
 * Date: 12/02/2018
6
 * Time: 23:10
7
 */
8
9
namespace Phpfastcache\Drivers\Redis;
10
11
use Phpfastcache\Config\ConfigurationOption;
12
use Redis as RedisClient;
13
14
class Config extends ConfigurationOption
15
{
16
    /**
17
     * @var string
18
     */
19
    protected $host = '127.0.0.1';
20
21
    /**
22
     * @var int
23
     */
24
    protected $port = 6379;
25
26
    /**
27
     * @var string
28
     */
29
    protected $password = '';
30
31
    /**
32
     * @var int
33
     */
34
    protected $database = 0;
35
36
    /**
37
     * @var int
38
     */
39
    protected $timeout = 5;
40
41
    /**
42
     * @var RedisClient
43
     */
44
    protected $redisClient;
45
46
    /**
47
     * @return string
48
     */
49
    public function getHost(): string
50
    {
51
        return $this->host;
52
    }
53
54
    /**
55
     * @param string $host
56
     * @return self
57
     */
58
    public function setHost(string $host): self
59
    {
60
        $this->host = $host;
61
        return $this;
62
    }
63
64
    /**
65
     * @return int
66
     */
67
    public function getPort(): int
68
    {
69
        return $this->port;
70
    }
71
72
    /**
73
     * @param int $port
74
     * @return self
75
     */
76
    public function setPort(int $port): self
77
    {
78
        $this->port = $port;
79
        return $this;
80
    }
81
82
    /**
83
     * @return mixed
84
     */
85
    public function getPassword()
86
    {
87
        return $this->password;
88
    }
89
90
    /**
91
     * @param string $password
92
     * @return self
93
     */
94
    public function setPassword(string $password): self
95
    {
96
        $this->password = $password;
97
        return $this;
98
    }
99
100
    /**
101
     * @return int
102
     */
103
    public function getDatabase(): int
104
    {
105
        return $this->database;
106
    }
107
108
    /**
109
     * @param int $database
110
     * @return self
111
     */
112
    public function setDatabase(int $database): self
113
    {
114
        $this->database = $database;
115
        return $this;
116
    }
117
118
    /**
119
     * @return int
120
     */
121
    public function getTimeout(): int
122
    {
123
        return $this->timeout;
124
    }
125
126
    /**
127
     * @param int $timeout
128
     * @return self
129
     */
130
    public function setTimeout(int $timeout): self
131
    {
132
        $this->timeout = $timeout;
133
        return $this;
134
    }
135
136
    /**
137
     * @return RedisClient|null
138
     */
139
    public function getRedisClient()
140
    {
141
        return $this->redisClient;
142
    }
143
144
    /**
145
     * @param RedisClient $predisClient|null
146
     * @return Config
147
     */
148
    public function setRedisClient(RedisClient $redisClient = null): Config
149
    {
150
        $this->redisClient = $redisClient;
151
        return $this;
152
    }
153
}