1 | <?php |
||
7 | class ClientConfig |
||
8 | { |
||
9 | private $scheme; |
||
10 | private $host; |
||
11 | private $user; |
||
12 | private $password; |
||
13 | private $port; |
||
14 | |||
15 | private $timeout = WscCommonsContract::DEFAULT_TIMEOUT; |
||
16 | private $headers = []; |
||
17 | private $fragmentSize = WscCommonsContract::DEFAULT_FRAGMENT_SIZE; |
||
18 | private $context; |
||
19 | |||
20 | // proxy settings |
||
21 | private $hasProxy = false; |
||
22 | private $proxyIp; |
||
23 | private $proxyPort; |
||
24 | private $proxyAuth; |
||
25 | |||
26 | private $contextOptions = []; |
||
27 | |||
28 | /** |
||
29 | * @return int |
||
30 | */ |
||
31 | public function getTimeout(): int |
||
35 | |||
36 | /** |
||
37 | * @param int $timeout |
||
38 | */ |
||
39 | public function setTimeout(int $timeout) |
||
43 | |||
44 | /** |
||
45 | * @return array |
||
46 | */ |
||
47 | public function getHeaders(): array |
||
51 | |||
52 | /** |
||
53 | * @param array $headers |
||
54 | */ |
||
55 | public function setHeaders(array $headers) |
||
59 | |||
60 | /** |
||
61 | * @return int |
||
62 | */ |
||
63 | public function getFragmentSize(): int |
||
67 | |||
68 | /** |
||
69 | * @param int $fragmentSize |
||
70 | */ |
||
71 | public function setFragmentSize(int $fragmentSize) |
||
75 | |||
76 | /** |
||
77 | * @return mixed |
||
78 | */ |
||
79 | public function getContext() |
||
83 | |||
84 | /** |
||
85 | * @param mixed $context |
||
86 | */ |
||
87 | public function setContext($context) |
||
91 | |||
92 | /** |
||
93 | * @return mixed |
||
94 | */ |
||
95 | public function getScheme(): string |
||
99 | |||
100 | /** |
||
101 | * @param void $scheme |
||
102 | */ |
||
103 | public function setScheme($scheme): void |
||
107 | |||
108 | /** |
||
109 | * @return string |
||
110 | */ |
||
111 | public function getHost(): string |
||
115 | |||
116 | /** |
||
117 | * @param void $host |
||
118 | */ |
||
119 | public function setHost($host): void |
||
123 | |||
124 | /** |
||
125 | * @return string |
||
126 | */ |
||
127 | public function getUser(): string |
||
131 | |||
132 | /** |
||
133 | * @param array $urlParts |
||
134 | */ |
||
135 | public function setUser(array $urlParts): void |
||
139 | |||
140 | /** |
||
141 | * @return string |
||
142 | */ |
||
143 | public function getPassword(): string |
||
147 | |||
148 | /** |
||
149 | * @param array $urlParts |
||
150 | */ |
||
151 | public function setPassword(array $urlParts): void |
||
155 | |||
156 | /** |
||
157 | * @return string |
||
158 | */ |
||
159 | public function getPort(): string |
||
163 | |||
164 | /** |
||
165 | * @param array $urlParts |
||
166 | */ |
||
167 | public function setPort(array $urlParts): void |
||
171 | |||
172 | /** |
||
173 | * @return array |
||
174 | */ |
||
175 | public function getContextOptions(): array |
||
179 | |||
180 | /** |
||
181 | * @param array $contextOptions |
||
182 | */ |
||
183 | public function setContextOptions($contextOptions): void |
||
187 | |||
188 | /** |
||
189 | * @param string $ip |
||
190 | * @param string $port |
||
191 | */ |
||
192 | public function setProxy(string $ip, string $port): void |
||
198 | |||
199 | /** |
||
200 | * Sets auth for proxy |
||
201 | * |
||
202 | * @param string $userName |
||
203 | * @param string $password |
||
204 | */ |
||
205 | public function setProxyAuth(string $userName, string $password): void |
||
209 | |||
210 | /** |
||
211 | * @return bool |
||
212 | */ |
||
213 | public function hasProxy() : bool |
||
217 | |||
218 | /** |
||
219 | * @return string|null |
||
220 | */ |
||
221 | public function getProxyIp() : ?string |
||
225 | |||
226 | /** |
||
227 | * @return string|null |
||
228 | */ |
||
229 | public function getProxyPort() : ?string |
||
233 | |||
234 | /** |
||
235 | * @return string|null |
||
236 | */ |
||
237 | public function getProxyAuth() : ?string |
||
241 | } |
||
242 |