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
This commit is contained in:
Fabien Potencier 2011-05-14 11:04:50 +02:00
commit dbdb3da6bf
3 changed files with 10 additions and 3 deletions

View File

@ -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);
}
}

View File

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

View File

@ -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;