| Total Complexity | 4 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | final class MemcachedServer |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var string memcached server hostname or IP address |
||
| 14 | */ |
||
| 15 | private $host; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var int memcached server port |
||
| 19 | */ |
||
| 20 | private $port; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @var int probability of using this server among all servers |
||
| 24 | */ |
||
| 25 | private $weight; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @param string $host memcached server hostname or IP address |
||
| 29 | * @param int $port memcached server port |
||
| 30 | * @param int $weight probability of using this server among all servers |
||
| 31 | */ |
||
| 32 | public function __construct(string $host, int $port = 11211, int $weight = 1) |
||
| 33 | { |
||
| 34 | $this->host = $host; |
||
| 35 | $this->port = $port; |
||
| 36 | $this->weight = $weight; |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @return string memcached server hostname or IP address |
||
| 41 | */ |
||
| 42 | public function getHost(): string |
||
| 43 | { |
||
| 44 | return $this->host; |
||
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @return int memcached server port |
||
| 49 | */ |
||
| 50 | public function getPort(): int |
||
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @return int probability of using this server among all servers |
||
| 57 | */ |
||
| 58 | public function getWeight(): int |
||
| 61 | } |
||
| 62 | } |
||
| 63 |