소스 검색

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