| 1 | <?php declare(strict_types=1); |
||
| 9 | final class ClientConfiguration |
||
| 10 | { |
||
| 11 | /** @var string */ |
||
| 12 | private $proto; |
||
| 13 | /** @var string */ |
||
| 14 | private $hosts; |
||
| 15 | /** @var string */ |
||
| 16 | private $username; |
||
| 17 | /** @var string */ |
||
| 18 | private $password; |
||
| 19 | /** @var array */ |
||
| 20 | private $options; |
||
| 21 | /** @var null|string */ |
||
| 22 | private $authSource; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * ClientConfiguration constructor. |
||
| 26 | * |
||
| 27 | * @param string $proto |
||
| 28 | * @param string $hosts |
||
| 29 | * @param string $username |
||
| 30 | * @param string $password |
||
| 31 | * @param string|null $authSource |
||
| 32 | * @param array $options |
||
| 33 | */ |
||
| 34 | 35 | public function __construct( |
|
| 35 | string $proto, |
||
| 36 | string $hosts, |
||
| 37 | string $username = '', |
||
| 38 | string $password = '', |
||
| 39 | string $authSource = null, |
||
| 40 | array $options = [] |
||
| 41 | ) { |
||
| 42 | 35 | $this->proto = $proto; |
|
| 43 | 35 | $this->hosts = $hosts; |
|
| 44 | 35 | $this->username = $username; |
|
| 45 | 35 | $this->password = $password; |
|
| 46 | 35 | $this->options = $options; |
|
| 47 | 35 | $this->authSource = $authSource; |
|
| 48 | 35 | } |
|
| 49 | |||
| 50 | /** |
||
| 51 | * @return string |
||
| 52 | */ |
||
| 53 | 33 | public function getProto(): string |
|
| 54 | { |
||
| 55 | 33 | return $this->proto; |
|
| 56 | } |
||
| 57 | |||
| 58 | /** |
||
| 59 | * @return string |
||
| 60 | */ |
||
| 61 | 33 | public function getHosts(): string |
|
| 62 | { |
||
| 63 | 33 | return $this->hosts; |
|
| 64 | } |
||
| 65 | |||
| 66 | /** |
||
| 67 | * @return string |
||
| 68 | */ |
||
| 69 | 5 | public function getUsername(): string |
|
| 70 | { |
||
| 71 | 5 | return $this->username; |
|
| 72 | } |
||
| 73 | |||
| 74 | /** |
||
| 75 | * @return string |
||
| 76 | */ |
||
| 77 | 5 | public function getPassword(): string |
|
| 78 | { |
||
| 79 | 5 | return $this->password; |
|
| 80 | } |
||
| 81 | |||
| 82 | /** |
||
| 83 | * @return null|string |
||
| 84 | */ |
||
| 85 | 28 | public function getAuthSource() |
|
| 86 | { |
||
| 87 | 28 | return $this->authSource; |
|
| 88 | } |
||
| 89 | |||
| 90 | /** |
||
| 91 | * @return array |
||
| 92 | */ |
||
| 93 | 33 | public function getOptions(): array |
|
| 105 | |||
| 106 | /** |
||
| 107 | * @param array $options |
||
| 108 | * |
||
| 109 | * @return array |
||
| 110 | */ |
||
| 111 | 33 | private function cleanOptions(array $options): array |
|
| 120 | } |
||
| 121 |