1 | <?php declare(strict_types = 1); |
||
9 | final class ClientConfiguration |
||
10 | { |
||
11 | /** @var string */ |
||
12 | private $hosts; |
||
13 | /** @var string */ |
||
14 | private $username; |
||
15 | /** @var string */ |
||
16 | private $password; |
||
17 | /** @var array */ |
||
18 | private $options; |
||
19 | /** @var null|string */ |
||
20 | private $authSource; |
||
21 | |||
22 | /** |
||
23 | * ClientConfiguration constructor. |
||
24 | * |
||
25 | * @param string $hosts |
||
26 | * @param string $username |
||
27 | * @param string $password |
||
28 | * @param string|null $authSource |
||
29 | * @param array $options |
||
30 | */ |
||
31 | 34 | public function __construct( |
|
32 | string $hosts, |
||
33 | string $username = '', |
||
34 | string $password = '', |
||
35 | string $authSource = null, |
||
36 | array $options = [] |
||
37 | ) { |
||
38 | 34 | $this->hosts = $hosts; |
|
39 | 34 | $this->username = $username; |
|
40 | 34 | $this->password = $password; |
|
41 | 34 | $this->options = $options; |
|
42 | 34 | $this->authSource = $authSource; |
|
43 | 34 | } |
|
44 | |||
45 | /** |
||
46 | * @return string |
||
47 | */ |
||
48 | 32 | public function getHosts(): string |
|
49 | { |
||
50 | 32 | return $this->hosts; |
|
51 | } |
||
52 | |||
53 | /** |
||
54 | * @return string |
||
55 | */ |
||
56 | 5 | public function getUsername(): string |
|
60 | |||
61 | /** |
||
62 | * @return string |
||
63 | */ |
||
64 | 5 | public function getPassword(): string |
|
68 | |||
69 | /** |
||
70 | * @return null|string |
||
71 | */ |
||
72 | 27 | public function getAuthSource() |
|
76 | |||
77 | /** |
||
78 | * @return array |
||
79 | */ |
||
80 | 32 | public function getOptions(): array |
|
92 | |||
93 | /** |
||
94 | * @param array $options |
||
95 | * |
||
96 | * @return array |
||
97 | */ |
||
98 | 32 | private function cleanOptions(array $options): array |
|
107 | } |
||
108 |