Improve encapsulation

This commit is contained in:
Philipp 2023-01-11 22:00:29 +01:00
parent 11a8bd17e3
commit fef10e8a57
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
4 changed files with 21 additions and 24 deletions

View file

@ -49,6 +49,24 @@ class Config implements IManageConfigValues
$this->configCache = $configCache;
}
/**
* Load all configuration values from a given cache and saves it back in the configuration node store
* @see ConfigFileManager::CONFIG_DATA_FILE
*
* All configuration values of the system are stored in the cache.
*
* @param Cache $cache a new cache
*
* @return void
*
* @throws ConfigPersistenceException In case the persistence layer throws errors
*/
public function setCacheAndSave(Cache $cache)
{
$this->configCache = $cache;
$this->save();
}
/**
* {@inheritDoc}
*/
@ -91,13 +109,6 @@ class Config implements IManageConfigValues
$this->configCache = $configCache;
}
/** {@inheritDoc} */
public function load(Cache $cache)
{
$this->configCache = $cache;
$this->save();
}
/** {@inheritDoc} */
public function get(string $cat, string $key = null, $default_value = null)
{