From a37018aab6c6d0fed1883d8e492e891416d4e505 Mon Sep 17 00:00:00 2001 From: Dmitriy Simushev Date: Wed, 29 Oct 2014 13:48:30 +0000 Subject: [PATCH] Add "default" argument to "Settings::get" method --- src/mibew/libs/classes/Mibew/Settings.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mibew/libs/classes/Mibew/Settings.php b/src/mibew/libs/classes/Mibew/Settings.php index be7d26b1..81dff311 100644 --- a/src/mibew/libs/classes/Mibew/Settings.php +++ b/src/mibew/libs/classes/Mibew/Settings.php @@ -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; } /**