Skip to content

Commit d4f8541

Browse files
committed
Get the current client account configuration
1 parent 94bcd6f commit d4f8541

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

src/Client.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,19 @@ public function setConfig(array $config): Client {
204204
return $this;
205205
}
206206

207+
/**
208+
* Get the current config
209+
*
210+
* @return array
211+
*/
212+
public function getConfig(): array {
213+
$config = [];
214+
foreach($this->default_account_config as $key => $value) {
215+
$config[$key] = $this->$key;
216+
}
217+
return $config;
218+
}
219+
207220
/**
208221
* Set a specific account config
209222
* @param string $key
@@ -220,6 +233,21 @@ private function setAccountConfig(string $key, array $config, array $default_con
220233
$this->$key = $value;
221234
}
222235

236+
/**
237+
* Get the current account config
238+
*
239+
* @return array
240+
*/
241+
public function getAccountConfig(): array {
242+
$config = [];
243+
foreach($this->default_account_config as $key => $value) {
244+
if(property_exists($this, $key)) {
245+
$config[$key] = $this->$key;
246+
}
247+
}
248+
return $config;
249+
}
250+
223251
/**
224252
* Look for a possible events in any available config
225253
* @param $config

0 commit comments

Comments
 (0)