1 | <?php |
||
14 | final class ModuleOptions implements ModuleOptionsInterface |
||
15 | { |
||
16 | /** @var AuthOptionsInterface */ |
||
17 | private $authOptions; |
||
18 | /** @var string */ |
||
19 | private $token; |
||
20 | /** @var string */ |
||
21 | private $tokenType; |
||
22 | /** @var int */ |
||
23 | private $timeout; |
||
24 | /** @var string */ |
||
25 | private $hostUrl; |
||
26 | |||
27 | /** |
||
28 | * ModuleOptions constructor. |
||
29 | * |
||
30 | * @param array $config |
||
31 | * @param AuthOptionsInterface $authOptions |
||
32 | * |
||
33 | * @throws InvalidParameterException |
||
34 | */ |
||
35 | 13 | public function __construct(array $config, AuthOptionsInterface $authOptions) |
|
46 | |||
47 | /** |
||
48 | * @return string |
||
49 | */ |
||
50 | 1 | public function getToken() :string |
|
54 | |||
55 | /** |
||
56 | * @return string |
||
57 | */ |
||
58 | 1 | public function getTokenType() :string |
|
62 | |||
63 | /** |
||
64 | * @return int |
||
65 | */ |
||
66 | 2 | public function getTimeout() :int |
|
70 | |||
71 | /** |
||
72 | * @return string |
||
73 | */ |
||
74 | 1 | public function getHostUrl() :string |
|
78 | |||
79 | /** |
||
80 | * @return AuthOptionsInterface |
||
81 | */ |
||
82 | 2 | public function getAuthOptions() : AuthOptionsInterface |
|
86 | |||
87 | /** |
||
88 | * @param array $config |
||
89 | * |
||
90 | * @return void |
||
91 | * @throws InvalidParameterException |
||
92 | */ |
||
93 | 12 | private function setToken(array $config) :void |
|
100 | |||
101 | /** |
||
102 | * @param array $config |
||
103 | * |
||
104 | * @return void |
||
105 | * @throws InvalidParameterException |
||
106 | */ |
||
107 | 10 | private function setTokenType(array $config) :void |
|
114 | |||
115 | /** |
||
116 | * @param array $config |
||
117 | * |
||
118 | * @return void |
||
119 | * @throws InvalidParameterException |
||
120 | */ |
||
121 | 8 | private function setTimeout(array $config) :void |
|
130 | |||
131 | /** |
||
132 | * @param array $config |
||
133 | * |
||
134 | * @return void |
||
135 | * @throws InvalidParameterException |
||
136 | */ |
||
137 | 5 | private function setHostUrl(array $config) :void |
|
144 | } |
||
145 |