1 | <?php |
||
55 | class Config implements ContextAwareInterface |
||
56 | { |
||
57 | use ContextTrait; |
||
58 | |||
59 | const OAUTH_URL = 'oauth_url'; |
||
60 | const CLIENT_ID = 'client_id'; |
||
61 | const CLIENT_SECRET = 'client_secret'; |
||
62 | const SCOPE = 'scope'; |
||
63 | const PROJECT = 'project'; |
||
64 | const API_URL = 'api_url'; |
||
65 | |||
66 | /** |
||
67 | * @var string |
||
68 | */ |
||
69 | protected $clientSecret; |
||
70 | |||
71 | /** |
||
72 | * @var string |
||
73 | */ |
||
74 | protected $clientId; |
||
75 | |||
76 | /** |
||
77 | * @var string |
||
78 | */ |
||
79 | protected $project; |
||
80 | |||
81 | /** |
||
82 | * @var string |
||
83 | */ |
||
84 | protected $scope = 'manage_project'; |
||
85 | |||
86 | /** |
||
87 | * @var string |
||
88 | */ |
||
89 | protected $oauthUrl = 'https://auth.sphere.io/oauth/token'; |
||
90 | |||
91 | /** |
||
92 | * @var string |
||
93 | */ |
||
94 | protected $apiUrl = 'https://api.sphere.io'; |
||
95 | |||
96 | /** |
||
97 | * @var int |
||
98 | */ |
||
99 | protected $batchPoolSize = 25; |
||
100 | |||
101 | protected $adapter; |
||
102 | |||
103 | /** |
||
104 | * @var bool |
||
105 | */ |
||
106 | protected $throwExceptions = false; |
||
107 | |||
108 | 297 | protected $acceptEncoding = 'gzip'; |
|
109 | |||
110 | 297 | /** |
|
111 | 297 | * @param array $configValues |
|
112 | * @return static |
||
113 | 297 | */ |
|
114 | 295 | public static function fromArray(array $configValues) |
|
130 | |||
131 | 295 | protected function camelize($scored) |
|
146 | 292 | ||
147 | /** |
||
148 | * @return string |
||
149 | */ |
||
150 | public function getClientSecret() |
||
154 | |||
155 | 293 | /** |
|
156 | * @param string $clientSecret |
||
157 | 293 | * @return $this |
|
158 | */ |
||
159 | public function setClientSecret($clientSecret) |
||
165 | 296 | ||
166 | /** |
||
167 | * @return string |
||
168 | */ |
||
169 | public function getClientId() |
||
173 | |||
174 | 293 | /** |
|
175 | * @param string $clientId |
||
176 | 293 | * @return $this |
|
177 | */ |
||
178 | public function setClientId($clientId) |
||
184 | 292 | ||
185 | /** |
||
186 | * @return string |
||
187 | */ |
||
188 | public function getProject() |
||
192 | |||
193 | 293 | /** |
|
194 | * @param string $project |
||
195 | 293 | * @return $this |
|
196 | */ |
||
197 | public function setProject($project) |
||
203 | 264 | ||
204 | /** |
||
205 | * @return string |
||
206 | */ |
||
207 | public function getScope() |
||
211 | |||
212 | 293 | /** |
|
213 | * @param string $scope |
||
214 | 293 | * @return $this |
|
215 | */ |
||
216 | public function setScope($scope) |
||
221 | |||
222 | 285 | /** |
|
223 | * @return string |
||
224 | */ |
||
225 | public function getOauthUrl() |
||
229 | |||
230 | 293 | /** |
|
231 | * @param string $oauthUrl |
||
232 | 293 | * @return $this |
|
233 | */ |
||
234 | public function setOauthUrl($oauthUrl) |
||
240 | 293 | ||
241 | 4 | /** |
|
242 | * @return string |
||
243 | */ |
||
244 | 289 | public function getApiUrl() |
|
248 | 289 | ||
249 | /** |
||
250 | * @param string $apiUrl |
||
251 | * @return $this |
||
252 | 289 | */ |
|
253 | public function setApiUrl($apiUrl) |
||
259 | |||
260 | 1 | /** |
|
261 | * @return bool |
||
262 | */ |
||
263 | public function check() |
||
279 | |||
280 | /** |
||
281 | * @return int |
||
282 | */ |
||
283 | public function getBatchPoolSize() |
||
287 | |||
288 | /** |
||
289 | * @param int $batchPoolSize |
||
290 | * @return $this |
||
291 | */ |
||
292 | public function setBatchPoolSize($batchPoolSize) |
||
298 | |||
299 | /** |
||
300 | * @return string |
||
301 | */ |
||
302 | 9 | public function getAdapter() |
|
306 | 9 | ||
307 | /** |
||
308 | * @param string $adapter |
||
309 | * @return $this |
||
310 | */ |
||
311 | public function setAdapter($adapter) |
||
317 | |||
318 | /** |
||
319 | * @return bool |
||
320 | */ |
||
321 | public function getThrowExceptions() |
||
325 | |||
326 | /** |
||
327 | * @param bool $throwExceptions |
||
328 | * @return $this |
||
329 | */ |
||
330 | 297 | public function setThrowExceptions($throwExceptions) |
|
336 | |||
337 | /** |
||
338 | * @return string |
||
339 | */ |
||
340 | public function getAcceptEncoding() |
||
344 | |||
345 | /** |
||
346 | * @param string $acceptEncoding |
||
347 | * @return $this |
||
348 | */ |
||
349 | public function setAcceptEncoding($acceptEncoding) |
||
355 | |||
356 | /** |
||
357 | * @return static |
||
358 | */ |
||
359 | public static function of() |
||
363 | } |
||
364 |