Преглед на файлове

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