소스 검색

[Form] fix calling closures

Victor Berchet 14 년 전
부모
커밋
ae4bfbada4
2개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 2
      src/Symfony/Component/Form/CallbackTransformer.php
  2. 1 1
      src/Symfony/Component/Form/Extension/Core/ChoiceList/ArrayChoiceList.php

+ 2 - 2
src/Symfony/Component/Form/CallbackTransformer.php

@@ -25,11 +25,11 @@ class CallbackTransformer implements DataTransformerInterface
 
     public function transform($data)
     {
-        return $this->transform->__invoke($data);
+        return call_user_func($this->transform, $data);
     }
 
     public function reverseTransform($data)
     {
-        return $this->reverseTransform->__invoke($data);
+        return call_user_func($this->reverseTransform, $data);
     }
 }

+ 1 - 1
src/Symfony/Component/Form/Extension/Core/ChoiceList/ArrayChoiceList.php

@@ -59,7 +59,7 @@ class ArrayChoiceList implements ChoiceListInterface
         $this->loaded = true;
 
         if ($this->choices instanceof \Closure) {
-            $this->choices = $this->choices->__invoke();
+            $this->choices = call_user_func($this->choices);
 
             if (!is_array($this->choices)) {
                 throw new UnexpectedTypeException($this->choices, 'array');