1 | <?php |
||
11 | final class AuthOptions implements AuthOptionsInterface |
||
12 | { |
||
13 | /** @var bool */ |
||
14 | private $isAuthorization = false; |
||
15 | /** @var string */ |
||
16 | private $authType = 'none'; |
||
17 | /** @var string */ |
||
18 | private $username = ''; |
||
19 | /** @var string */ |
||
20 | private $password = ''; |
||
21 | |||
22 | /** |
||
23 | * Config constructor. |
||
24 | * |
||
25 | * @param array $config |
||
26 | * |
||
27 | * @throws InvalidParameterException |
||
28 | */ |
||
29 | 11 | public function __construct(array $config) |
|
37 | |||
38 | /** |
||
39 | * @return bool |
||
40 | */ |
||
41 | 4 | public function isAuthorization() : bool |
|
45 | |||
46 | /** |
||
47 | * @return string |
||
48 | */ |
||
49 | 3 | public function getAuthType() : string |
|
53 | |||
54 | /** |
||
55 | * @return string |
||
56 | */ |
||
57 | 2 | public function getUsername() : string |
|
61 | |||
62 | /** |
||
63 | * @return string |
||
64 | */ |
||
65 | 2 | public function getPassword() : string |
|
69 | |||
70 | /** |
||
71 | * @param $config |
||
72 | * |
||
73 | * @throws InvalidParameterException |
||
74 | */ |
||
75 | 6 | private function checkCredentials($config) :void |
|
80 | |||
81 | /** |
||
82 | * @param array $config |
||
83 | * |
||
84 | * @throws InvalidParameterException |
||
85 | */ |
||
86 | 6 | private function checkUsername(array $config) :void |
|
93 | |||
94 | /** |
||
95 | * @param array $config |
||
96 | * |
||
97 | * @throws InvalidParameterException |
||
98 | */ |
||
99 | 4 | private function checkPassword(array $config) :void |
|
106 | |||
107 | /** |
||
108 | * @param array $config |
||
109 | */ |
||
110 | 6 | private function setAuthType(array $config) :void |
|
117 | |||
118 | /** |
||
119 | * @param array $config |
||
120 | * |
||
121 | * @throws InvalidParameterException |
||
122 | */ |
||
123 | 8 | private function checkAuthorization(array $config) :void |
|
133 | } |
||
134 |