Procházet zdrojové kódy

Merge remote branch 'vicb/form-misc-fix-2'

* vicb/form-misc-fix-2:
  [Form] fix calling closures
  [Form] Add a missing property delcaration in the ResizeFormListener
Fabien Potencier před 14 roky
rodič
revize
dbdb3da6bf

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

+ 7 - 0
src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php

@@ -36,10 +36,17 @@ class ResizeFormListener implements EventSubscriberInterface
     private $type;
 
     /**
+     * Whether children could be added to the group
      * @var Boolean
      */
     private $allowAdd;
 
+    /**
+     * Whether children could be removed from the group
+     * @var Boolean
+     */
+    private $allowDelete;
+
     public function __construct(FormFactoryInterface $factory, $type, $allowAdd = false, $allowDelete = false)
     {
         $this->factory = $factory;