Remove get() from config transaction interface
This commit is contained in:
parent
b439df892a
commit
a46cd2fb36
|
@ -29,22 +29,6 @@ use Friendica\Core\Config\Exception\ConfigPersistenceException;
|
||||||
*/
|
*/
|
||||||
interface ISetConfigValuesTransactionally
|
interface ISetConfigValuesTransactionally
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Get a particular user's config variable given the category name
|
|
||||||
* ($cat) and a $key.
|
|
||||||
*
|
|
||||||
* Get a particular config value from the given category ($cat)
|
|
||||||
*
|
|
||||||
* @param string $cat The category of the configuration value
|
|
||||||
* @param string $key The configuration key to query
|
|
||||||
*
|
|
||||||
* @return mixed Stored value or null if it does not exist
|
|
||||||
*
|
|
||||||
* @throws ConfigPersistenceException In case the persistence layer throws errors
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public function get(string $cat, string $key);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets a configuration value for system config
|
* Sets a configuration value for system config
|
||||||
*
|
*
|
||||||
|
|
|
@ -45,8 +45,20 @@ class ConfigTransaction implements ISetConfigValuesTransactionally
|
||||||
$this->delCache = new Cache();
|
$this->delCache = new Cache();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/**
|
||||||
public function get(string $cat, string $key)
|
* Get a particular user's config variable given the category name
|
||||||
|
* ($cat) and a $key from the current transaction.
|
||||||
|
*
|
||||||
|
* Isn't part of the interface because of it's rare use case
|
||||||
|
*
|
||||||
|
* @param string $cat The category of the configuration value
|
||||||
|
* @param string $key The configuration key to query
|
||||||
|
*
|
||||||
|
* @return mixed Stored value or null if it does not exist
|
||||||
|
*
|
||||||
|
* @throws ConfigPersistenceException In case the persistence layer throws errors
|
||||||
|
*
|
||||||
|
*/ public function get(string $cat, string $key)
|
||||||
{
|
{
|
||||||
return !$this->delCache->get($cat, $key) ?
|
return !$this->delCache->get($cat, $key) ?
|
||||||
($this->cache->get($cat, $key) ?? $this->config->get($cat, $key)) :
|
($this->cache->get($cat, $key) ?? $this->config->get($cat, $key)) :
|
||||||
|
|
Loading…
Reference in a new issue