Add "default" argument to "Settings::get" method

This commit is contained in:
Dmitriy Simushev 2014-10-29 13:48:30 +00:00
parent be7d49c0f5
commit a37018aab6

View File

@ -136,13 +136,17 @@ class Settings
* Get setting value.
*
* @param string $name Variable's name
* @param mixed $default A value which will be used if the variable is not
* set.
* @return mixed
*/
public static function get($name)
public static function get($name, $default = null)
{
$instance = self::getInstance();
return $instance->settings[$name];
return isset($instance->settings[$name])
? $instance->settings[$name]
: $default;
}
/**