[Config] added the possibility to use a Closure for default values
This commit is contained in:
parent
2610e1b699
commit
e0df94cb8b
@ -49,7 +49,7 @@ class VariableNode extends BaseNode implements PrototypeNodeInterface
|
|||||||
*/
|
*/
|
||||||
public function getDefaultValue()
|
public function getDefaultValue()
|
||||||
{
|
{
|
||||||
return $this->defaultValue;
|
return $this->defaultValue instanceof \Closure ? call_user_func($this->defaultValue) : $this->defaultValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user