Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Update JRegistry::def to support not string defaults. #1550

Merged
merged 1 commit into from Sep 26, 2012
Jump to file or symbol
Failed to load files and symbols.
+3 −3
Split
@@ -99,15 +99,15 @@ public function jsonSerialize()
* Sets a default value if not already assigned.
*
* @param string $key The name of the parameter.
- * @param string $default An optional value for the parameter.
+ * @param mixed $default An optional value for the parameter.
*
- * @return string The value set, or the default if the value was not previously set (or null).
+ * @return mixed The value set, or the default if the value was not previously set (or null).
*
* @since 11.1
*/
public function def($key, $default = '')
{
- $value = $this->get($key, (string) $default);
+ $value = $this->get($key, $default);
$this->set($key, $value);
return $value;
}