Merge pull request #136 from StudioMaX/patch-1

Add configureOptions method to form types for SF 2.7
This commit is contained in:
Grégoire Passault 2015-08-18 20:19:33 +02:00
commit 84760b0a9f
1 changed files with 11 additions and 1 deletions

View File

@ -7,6 +7,7 @@ use Symfony\Component\Form\FormView;
use Symfony\Component\Form\FormInterface; use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\OptionsResolver\OptionsResolverInterface; use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\Form\FormEvents; use Symfony\Component\Form\FormEvents;
use Symfony\Component\Translation\TranslatorInterface; use Symfony\Component\Translation\TranslatorInterface;
@ -122,12 +123,21 @@ class CaptchaType extends AbstractType
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function setDefaultOptions(OptionsResolverInterface $resolver) public function configureOptions(OptionsResolver $resolver)
{ {
$this->options['mapped'] = false; $this->options['mapped'] = false;
$resolver->setDefaults($this->options); $resolver->setDefaults($this->options);
} }
/**
* {@inheritdoc}
* BC for SF < 2.7
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$this->configureOptions($resolver);
}
/** /**
* @return string * @return string
*/ */