* vicb/form-misc-fix-2: [Form] fix calling closures [Form] Add a missing property delcaration in the ResizeFormListener
@@ -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);
@@ -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');
@@ -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;