Allow closures as Config default.

This commit is contained in:
Taylor Otwell
2011-07-06 14:37:59 -07:00
parent 57f61dc54c
commit e2973e565d

View File

@@ -44,7 +44,7 @@ class Config {
// Verify that the configuration file actually exists.
if ( ! array_key_exists($file, static::$items))
{
return $default;
return is_callable($default) ? call_user_func($default) : $default;
}
return Arr::get(static::$items[$file], $key, $default);