Pārlūkot izejas kodu

[Form] fix calling closures

Victor Berchet 14 gadi atpakaļ
vecāks
revīzija
ae4bfbada4

+ 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');