mirror of
https://github.com/Mibew/mibew.git
synced 2025-01-31 13:24:41 +03:00
Add "default" argument to "Settings::get" method
This commit is contained in:
parent
be7d49c0f5
commit
a37018aab6
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user