[Config] added the possibility to use a Closure for default values

This commit is contained in:
Fabien Potencier 2011-03-16 09:19:34 +01:00
parent 2610e1b699
commit e0df94cb8b

View File

@ -49,7 +49,7 @@ class VariableNode extends BaseNode implements PrototypeNodeInterface
*/
public function getDefaultValue()
{
return $this->defaultValue;
return $this->defaultValue instanceof \Closure ? call_user_func($this->defaultValue) : $this->defaultValue;
}
/**