Преглед изворни кода

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

Fabien Potencier пре 14 година
родитељ
комит
e0df94cb8b
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      src/Symfony/Component/Config/Definition/VariableNode.php

+ 1 - 1
src/Symfony/Component/Config/Definition/VariableNode.php

@@ -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;
     }
 
     /**