From: Michael M Slusarz Date: Fri, 29 Jan 2010 04:20:57 +0000 (-0700) Subject: Some initial work on cleaning up some Horde_Variables documentation X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=36e9cd29528f5770a7068353c93413fb99521b40;p=horde.git Some initial work on cleaning up some Horde_Variables documentation --- diff --git a/framework/Util/lib/Horde/Variables.php b/framework/Util/lib/Horde/Variables.php index 624344d1d..e660a1eac 100644 --- a/framework/Util/lib/Horde/Variables.php +++ b/framework/Util/lib/Horde/Variables.php @@ -1,6 +1,6 @@ _expectedVariables) && - $this->_exists($this->_expectedVariables, $varname, false)) { - return true; - } - - return $this->_exists($this->_vars, $varname, false); + return (count($this->_expectedVariables) && + $this->_exists($this->_expectedVariables, $varname, false)) || + $this->_exists($this->_vars, $varname, false); } /** @@ -181,6 +191,8 @@ class Horde_Variables /** * Set $varname to $value ONLY if it's not already present. + * + * @ */ public function add($varname, $value) { @@ -214,14 +226,10 @@ class Horde_Variables * Fetch the requested variable ($varname) into $value, and return * whether or not the variable was set in $array. * - * @param array $array The array to search in (usually either - * $this->_vars or $this->_expectedVariables). - * @param string $varname The name of the variable to look for. + * @param array $array See _exists(). + * @param string $varname See _exists(). * @param mixed &$value $varname's value gets assigned to this variable. - * @param boolean $check If we don't find $varname, should we check - * $this->_expectedVariables to see if should - * have existed (like a checkbox or select - * multiple). + * @param boolean $check See _exists(). * * @return boolean Whether or not the variable was set (or, if we've * checked $this->_expectedVariables, should have been @@ -266,9 +274,9 @@ class Horde_Variables // $this->_expectedVariables, do so, but make sure not // to check it again. return $this->_exists($this->_expectedVariables, $varname, false); - } else { - return false; } + + return false; } }