| 1 | <?php |
||
| 10 | class ClientConfiguration |
||
| 11 | { |
||
| 12 | /** @var string */ |
||
| 13 | private $host; |
||
| 14 | /** @var int */ |
||
| 15 | private $port; |
||
| 16 | /** @var string */ |
||
| 17 | private $username; |
||
| 18 | /** @var string */ |
||
| 19 | private $password; |
||
| 20 | /** |
||
| 21 | * @var array |
||
| 22 | */ |
||
| 23 | private $options; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * ClientConfiguration constructor. |
||
| 27 | * |
||
| 28 | * @param string $host |
||
| 29 | 4 | * @param int $port |
|
| 30 | * @param string $username |
||
| 31 | 4 | * @param string $password |
|
| 32 | 4 | * @param array $options |
|
| 33 | 4 | */ |
|
| 34 | 4 | public function __construct( |
|
| 35 | 4 | string $host, |
|
| 36 | int $port, |
||
| 37 | string $username = '', |
||
| 38 | string $password = '', |
||
| 39 | array $options = [] |
||
| 40 | 4 | ) { |
|
| 41 | $this->host = $host; |
||
| 42 | 4 | $this->port = $port; |
|
| 43 | $this->username = $username; |
||
| 44 | $this->password = $password; |
||
| 45 | $this->options = $this->cleanOptions($options); |
||
| 46 | } |
||
| 47 | |||
| 48 | 4 | /** |
|
| 49 | * @return string |
||
| 50 | 4 | */ |
|
| 51 | public function getHost(): string |
||
| 52 | { |
||
| 53 | return $this->host; |
||
| 54 | } |
||
| 55 | |||
| 56 | 2 | /** |
|
| 57 | * @return int |
||
| 58 | 2 | */ |
|
| 59 | public function getPort(): int |
||
| 60 | { |
||
| 61 | return $this->port; |
||
| 62 | } |
||
| 63 | |||
| 64 | 2 | /** |
|
| 65 | * @return string |
||
| 66 | 2 | */ |
|
| 67 | public function getUsername(): string |
||
| 68 | { |
||
| 69 | return $this->username; |
||
| 70 | } |
||
| 71 | |||
| 72 | 2 | /** |
|
| 73 | * @return string |
||
| 74 | */ |
||
| 75 | 2 | public function getPassword(): string |
|
| 79 | |||
| 80 | /** |
||
| 81 | * @return array |
||
| 82 | */ |
||
| 83 | public function getOptions(): array |
||
| 93 | |||
| 94 | /** |
||
| 95 | * @param array $options |
||
| 96 | * |
||
| 97 | * @return array |
||
| 98 | */ |
||
| 99 | private function cleanOptions(array $options): array |
||
| 105 | } |
||
| 106 |