diff options
| author | 2015-01-07 17:36:29 +0100 | |
|---|---|---|
| committer | 2015-01-07 17:36:29 +0100 | |
| commit | fb614ab80cf038416e5451b4f6f25f421d75d8e4 (patch) | |
| tree | 94ac657f352caaa6f9086e0382b7f39a133dbe8e /lib | |
| parent | 2fd8a80878441cf59b1689b1765633694cb320b6 (diff) | |
Change way to call configuration setter.
- Add a support($key) method which return if the given key is supported by
the setter.
- Change handle signature by adding a $data param which must be passed by
reference.
See https://github.com/FreshRSS/FreshRSS/issues/730
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/Minz/Configuration.php | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/Minz/Configuration.php b/lib/Minz/Configuration.php index 019b47fae..6044fc269 100644 --- a/lib/Minz/Configuration.php +++ b/lib/Minz/Configuration.php @@ -176,11 +176,9 @@ class Minz_Configuration { * @param $value the value to set. If null, the key is removed from the configuration. */ public function _param($key, $value = null) { - if (!is_null($this->configuration_setter)) { - $value = $this->configuration_setter->handle($key, $value); - } - - if (isset($this->data[$key]) && is_null($value)) { + if (!is_null($this->configuration_setter) && $this->configuration_setter->support($key)) { + $this->configuration_setter->handle($this->data, $key, $value); + } elseif (isset($this->data[$key]) && is_null($value)) { unset($this->data[$key]); } elseif (!is_null($value)) { $this->data[$key] = $value; |
