| Total Complexity | 12 |
| Total Lines | 138 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 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 |
||
| 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() |
||
| 142 | } |
||
| 143 | |||
| 144 | /** |
||
| 145 | * @param RedisClient $predisClient|null |
||
| 146 | * @return Config |
||
| 147 | */ |
||
| 148 | public function setRedisClient(RedisClient $redisClient = null): Config |
||
| 152 | } |
||
| 153 | } |