added default option to bundle::option method.
This commit is contained in:
@@ -422,13 +422,19 @@ class Bundle {
|
||||
*
|
||||
* @param string $bundle
|
||||
* @param string $option
|
||||
* @param mixed $default
|
||||
* @return mixed
|
||||
*/
|
||||
public static function option($bundle, $option)
|
||||
public static function option($bundle, $option, $default = null)
|
||||
{
|
||||
$bundle = static::get($bundle);
|
||||
|
||||
if ( ! is_null($bundle)) return array_get($bundle, $option);
|
||||
if (is_null($bundle))
|
||||
{
|
||||
return value($default);
|
||||
}
|
||||
|
||||
return array_get($bundle, $option, $default);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user